From 1a28237b4240f267a465e5179decbfdd7a26bf47 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Mon, 6 Apr 2015 13:47:24 -0700 Subject: [PATCH] Alter libcore::result example to utilize closure param 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. --- src/libcore/result.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/result.rs b/src/libcore/result.rs index 67a5ab891f72..4ac169f00680 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -69,7 +69,7 @@ //! let good_result: Result = good_result.and_then(|i| Ok(i == 11)); //! //! // Use `or_else` to handle the error. -//! let bad_result: Result = bad_result.or_else(|i| Ok(11)); +//! let bad_result: Result = bad_result.or_else(|i| Ok(i + 20)); //! //! // Consume the result and return the contents with `unwrap`. //! let final_awesome_result = good_result.unwrap();