Skip to content

Commit fb956dc

Browse files
committed
rollup merge of rust-lang#24048: frewsxcv/patch-11
Since it doesn't utilize the parameter, it's not very idiomatic since it could just use the `Result::or` method. So this changes the example to utilize the parameter. As far as I can tell, all the numbers in this example are completely arbitrary.
2 parents dabf0c6 + 1a28237 commit fb956dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/result.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
//! let good_result: Result<bool, i32> = good_result.and_then(|i| Ok(i == 11));
7070
//!
7171
//! // Use `or_else` to handle the error.
72-
//! let bad_result: Result<i32, i32> = bad_result.or_else(|i| Ok(11));
72+
//! let bad_result: Result<i32, i32> = bad_result.or_else(|i| Ok(i + 20));
7373
//!
7474
//! // Consume the result and return the contents with `unwrap`.
7575
//! let final_awesome_result = good_result.unwrap();

0 commit comments

Comments
 (0)