diff options
Diffstat (limited to 'src/libstd/result.rs')
| -rw-r--r-- | src/libstd/result.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libstd/result.rs b/src/libstd/result.rs index 92315b5d47a..957ba4a0438 100644 --- a/src/libstd/result.rs +++ b/src/libstd/result.rs @@ -47,7 +47,7 @@ impl<T, E: ToStr> Result<T, E> { pub fn get_ref<'a>(&'a self) -> &'a T { match *self { Ok(ref t) => t, - Err(ref e) => fail2!("called `Result::get_ref()` on `Err` value: {}", + Err(ref e) => fail!("called `Result::get_ref()` on `Err` value: {}", e.to_str()), } } @@ -108,7 +108,7 @@ impl<T, E: ToStr> Result<T, E> { pub fn unwrap(self) -> T { match self { Ok(t) => t, - Err(e) => fail2!("called `Result::unwrap()` on `Err` value: {}", + Err(e) => fail!("called `Result::unwrap()` on `Err` value: {}", e.to_str()), } } @@ -126,7 +126,7 @@ impl<T, E: ToStr> Result<T, E> { pub fn expect(self, reason: &str) -> T { match self { Ok(t) => t, - Err(_) => fail2!("{}", reason.to_owned()), + Err(_) => fail!("{}", reason.to_owned()), } } @@ -136,7 +136,7 @@ impl<T, E: ToStr> Result<T, E> { pub fn expect_err(self, reason: &str) -> E { match self { Err(e) => e, - Ok(_) => fail2!("{}", reason.to_owned()), + Ok(_) => fail!("{}", reason.to_owned()), } } @@ -571,7 +571,7 @@ mod tests { Err(2)); // test that it does not take more elements than it needs - let functions = [|| Ok(()), || Err(1), || fail2!()]; + let functions = [|| Ok(()), || Err(1), || fail!()]; assert_eq!(collect(functions.iter().map(|f| (*f)())), Err(1)); @@ -591,7 +591,7 @@ mod tests { Err(2)); // test that it does not take more elements than it needs - let functions = [|| Ok(()), || Err(1), || fail2!()]; + let functions = [|| Ok(()), || Err(1), || fail!()]; assert_eq!(fold_(functions.iter() .map(|f| (*f)())), |
