]> git.lizzy.rs Git - rust.git/blobdiff - src/libcore/result.rs
std: Rename Show/String to Debug/Display
[rust.git] / src / libcore / result.rs
index 110bce5c12472a1702113e7fc8d5cd5601c325b8..c3d49e24978455c5ab75a0c66cf6ab2e14723c25 100644 (file)
 //! makes it clear:
 //!
 //! ```
-//! # #![feature(macro_rules)]
 //! macro_rules! try {
 //!     ($e:expr) => (match $e { Ok(e) => e, Err(e) => return Err(e) })
 //! }
-//! # fn main() { }
 //! ```
 //!
 //! `try!` is imported by the prelude, and is available everywhere.
 use self::Result::{Ok, Err};
 
 use clone::Clone;
-use fmt::Show;
+use fmt::Display;
 use iter::{Iterator, IteratorExt, DoubleEndedIterator, FromIterator, ExactSizeIterator};
 use ops::{FnMut, FnOnce};
 use option::Option::{self, None, Some};
@@ -716,7 +714,7 @@ pub fn unwrap_or_else<F: FnOnce(E) -> T>(self, op: F) -> T {
 }
 
 #[stable]
-impl<T, E: Show> Result<T, E> {
+impl<T, E: Display> Result<T, E> {
     /// Unwraps a result, yielding the content of an `Ok`.
     ///
     /// # Panics
@@ -741,13 +739,13 @@ pub fn unwrap(self) -> T {
         match self {
             Ok(t) => t,
             Err(e) =>
-                panic!("called `Result::unwrap()` on an `Err` value: {:?}", e)
+                panic!("called `Result::unwrap()` on an `Err` value: {}", e)
         }
     }
 }
 
 #[stable]
-impl<T: Show, E> Result<T, E> {
+impl<T: Display, E> Result<T, E> {
     /// Unwraps a result, yielding the content of an `Err`.
     ///
     /// # Panics
@@ -771,7 +769,7 @@ impl<T: Show, E> Result<T, E> {
     pub fn unwrap_err(self) -> E {
         match self {
             Ok(t) =>
-                panic!("called `Result::unwrap_err()` on an `Ok` value: {:?}", t),
+                panic!("called `Result::unwrap_err()` on an `Ok` value: {}", t),
             Err(e) => e
         }
     }