From: Boris Egorov Date: Wed, 25 Nov 2015 07:59:21 +0000 (+0600) Subject: trpl: Fix example logic in error handling chapter X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=b892b5a6903adc2dfbdac793b9da1e9a0b575a40;p=rust.git trpl: Fix example logic in error handling chapter --- diff --git a/src/doc/book/error-handling.md b/src/doc/book/error-handling.md index e37360a457b..af6846e65de 100644 --- a/src/doc/book/error-handling.md +++ b/src/doc/book/error-handling.md @@ -681,6 +681,7 @@ fn double_arg(mut argv: env::Args) -> Result { argv.nth(1) .ok_or("Please give at least one argument".to_owned()) .and_then(|arg| arg.parse::().map_err(|err| err.to_string())) + .map(|n| 2 * n) } fn main() {