diff options
| author | Sean McArthur <sean.monstar@gmail.com> | 2015-03-30 17:56:48 -0700 |
|---|---|---|
| committer | Sean McArthur <sean.monstar@gmail.com> | 2015-03-30 18:08:58 -0700 |
| commit | e17f4fc1d4545f5c17b21805c5145b05495484ee (patch) | |
| tree | 73738e0f820177de7d6052ad15e01c868d7a24ae /src/liballoc | |
| parent | 9de34a84bb300bab1bf0227f577331620cd60511 (diff) | |
| download | rust-e17f4fc1d4545f5c17b21805c5145b05495484ee.tar.gz rust-e17f4fc1d4545f5c17b21805c5145b05495484ee.zip | |
convert: remove FromError, use From<E> instead
This removes the FromError trait, since it can now be expressed using the new convert::Into trait. All implementations of FromError<E> where changed to From<E>, and `try!` was changed to use From::from instead. Because this removes FromError, it is a breaking change, but fixing it simply requires changing the words `FromError` to `From`, and `from_error` to `from`. [breaking-change]
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/boxed.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index f9bd0ab2f1e..94a497dfe85 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -51,7 +51,7 @@ use core::prelude::*; use core::any::Any; use core::cmp::Ordering; use core::default::Default; -use core::error::{Error, FromError}; +use core::error::Error; use core::fmt; use core::hash::{self, Hash}; use core::mem; @@ -322,8 +322,8 @@ impl<I: DoubleEndedIterator + ?Sized> DoubleEndedIterator for Box<I> { impl<I: ExactSizeIterator + ?Sized> ExactSizeIterator for Box<I> {} #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, E: Error + 'a> FromError<E> for Box<Error + 'a> { - fn from_error(err: E) -> Box<Error + 'a> { +impl<'a, E: Error + 'a> From<E> for Box<Error + 'a> { + fn from(err: E) -> Box<Error + 'a> { Box::new(err) } } |
