//! 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};
}
#[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
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
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
}
}