Skip to content

Commit c88efe4

Browse files
committed
Fix the unstable book to account for ok-wrapping
1 parent aeb2353 commit c88efe4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/doc/unstable-book/src/language-features/catch-expr.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ expression creates a new scope one can use the `?` operator in.
1515
use std::num::ParseIntError;
1616

1717
let result: Result<i32, ParseIntError> = do catch {
18-
Ok("1".parse::<i32>()?
18+
"1".parse::<i32>()?
1919
+ "2".parse::<i32>()?
20-
+ "3".parse::<i32>()?)
20+
+ "3".parse::<i32>()?
2121
};
2222
assert_eq!(result, Ok(6));
2323

2424
let result: Result<i32, ParseIntError> = do catch {
25-
Ok("1".parse::<i32>()?
25+
"1".parse::<i32>()?
2626
+ "foo".parse::<i32>()?
27-
+ "3".parse::<i32>()?)
27+
+ "3".parse::<i32>()?
2828
};
2929
assert!(result.is_err());
3030
```

0 commit comments

Comments
 (0)