about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-03-20 23:16:47 +0000
committerbors <bors@rust-lang.org>2015-03-20 23:16:47 +0000
commite2fa53e593a854a609ae9efe5a1bbe15265f0a6f (patch)
tree31d6cf6dcb795deb1b8bda95d58cfbf02002000b /src/libcore
parent68d69415637186755482d2584e6ba82b67bc1d89 (diff)
parentb4a1e59146c70a12d8c4c1f85c08a2ecf9fb3d2e (diff)
downloadrust-e2fa53e593a854a609ae9efe5a1bbe15265f0a6f.tar.gz
rust-e2fa53e593a854a609ae9efe5a1bbe15265f0a6f.zip
Auto merge of #23512 - oli-obk:result_ok_unwrap, r=alexcrichton
because then the call to `unwrap()` will not print the error object.
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/result.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/result.rs b/src/libcore/result.rs
index a5b2fddfd5d..8dd91fd6500 100644
--- a/src/libcore/result.rs
+++ b/src/libcore/result.rs
@@ -78,7 +78,7 @@
 //! let bad_result: Result<int, int> = bad_result.or_else(|i| Ok(11));
 //!
 //! // Consume the result and return the contents with `unwrap`.
-//! let final_awesome_result = good_result.ok().unwrap();
+//! let final_awesome_result = good_result.unwrap();
 //! ```
 //!
 //! # Results must be used
@@ -460,7 +460,7 @@ impl<T, E> Result<T, E> {
     ///         line.trim_right().parse::<int>().unwrap_or(0)
     ///     });
     ///     // Add the value if there were no errors, otherwise add 0
-    ///     sum += val.ok().unwrap_or(0);
+    ///     sum += val.unwrap_or(0);
     /// }
     ///
     /// assert!(sum == 10);