diff options
| author | Scott McMurray <scottmcm@users.noreply.github.com> | 2018-04-03 09:20:24 -0700 |
|---|---|---|
| committer | Scott McMurray <scottmcm@users.noreply.github.com> | 2018-04-10 20:03:40 -0700 |
| commit | c88efe46b85c0b1b1f9adfcd3366edf7456ad59a (patch) | |
| tree | df1b18f8f373cea7c01ade56315c78913c93c3eb | |
| parent | aeb2353df54b2ca5fe0980766a023e028a0afa35 (diff) | |
| download | rust-c88efe46b85c0b1b1f9adfcd3366edf7456ad59a.tar.gz rust-c88efe46b85c0b1b1f9adfcd3366edf7456ad59a.zip | |
Fix the unstable book to account for ok-wrapping
| -rw-r--r-- | src/doc/unstable-book/src/language-features/catch-expr.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/doc/unstable-book/src/language-features/catch-expr.md b/src/doc/unstable-book/src/language-features/catch-expr.md index fbd213dca56..247333d841a 100644 --- a/src/doc/unstable-book/src/language-features/catch-expr.md +++ b/src/doc/unstable-book/src/language-features/catch-expr.md @@ -15,16 +15,16 @@ expression creates a new scope one can use the `?` operator in. use std::num::ParseIntError; let result: Result<i32, ParseIntError> = do catch { - Ok("1".parse::<i32>()? + "1".parse::<i32>()? + "2".parse::<i32>()? - + "3".parse::<i32>()?) + + "3".parse::<i32>()? }; assert_eq!(result, Ok(6)); let result: Result<i32, ParseIntError> = do catch { - Ok("1".parse::<i32>()? + "1".parse::<i32>()? + "foo".parse::<i32>()? - + "3".parse::<i32>()?) + + "3".parse::<i32>()? }; assert!(result.is_err()); ``` |
