Skip to content

Commit b892b5a

Browse files
committed
trpl: Fix example logic in error handling chapter
1 parent 7fa2c6c commit b892b5a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/doc/book/error-handling.md

+1
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,7 @@ fn double_arg(mut argv: env::Args) -> Result<i32, String> {
681681
argv.nth(1)
682682
.ok_or("Please give at least one argument".to_owned())
683683
.and_then(|arg| arg.parse::<i32>().map_err(|err| err.to_string()))
684+
.map(|n| 2 * n)
684685
}
685686

686687
fn main() {

0 commit comments

Comments
 (0)