about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-04-14 10:55:40 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-04-14 10:55:40 -0700
commitfb956dc5261aa96e6d22fd0d0909ae420b3619fc (patch)
tree1a4779ca0ac794e50e8976599e0f4d66643b7109
parentdabf0c6371d3b193664f58746fa27c1835a010f3 (diff)
parent1a28237b4240f267a465e5179decbfdd7a26bf47 (diff)
downloadrust-fb956dc5261aa96e6d22fd0d0909ae420b3619fc.tar.gz
rust-fb956dc5261aa96e6d22fd0d0909ae420b3619fc.zip
rollup merge of #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.
-rw-r--r--src/libcore/result.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcore/result.rs b/src/libcore/result.rs
index 67a5ab891f7..4ac169f0068 100644
--- a/src/libcore/result.rs
+++ b/src/libcore/result.rs
@@ -69,7 +69,7 @@
 //! let good_result: Result<bool, i32> = good_result.and_then(|i| Ok(i == 11));
 //!
 //! // Use `or_else` to handle the error.
-//! let bad_result: Result<i32, i32> = bad_result.or_else(|i| Ok(11));
+//! let bad_result: Result<i32, i32> = bad_result.or_else(|i| Ok(i + 20));
 //!
 //! // Consume the result and return the contents with `unwrap`.
 //! let final_awesome_result = good_result.unwrap();