about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBoris Egorov <egorov@linux.com>2015-11-25 13:59:21 +0600
committerBoris Egorov <egorov@linux.com>2015-11-25 14:07:43 +0600
commitb892b5a6903adc2dfbdac793b9da1e9a0b575a40 (patch)
treea6887e9c8547b243655b31020bb5340f27ca5b7d
parent7fa2c6ca31ae7ad8beb35ed11493339684786a10 (diff)
trpl: Fix example logic in error handling chapter
-rw-r--r--src/doc/book/error-handling.md1
1 files changed, 1 insertions, 0 deletions
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<i32, String> {
     argv.nth(1)
         .ok_or("Please give at least one argument".to_owned())
         .and_then(|arg| arg.parse::<i32>().map_err(|err| err.to_string()))
+        .map(|n| 2 * n)
 }
 
 fn main() {