From e17f4fc1d4545f5c17b21805c5145b05495484ee Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Mon, 30 Mar 2015 17:56:48 -0700 Subject: convert: remove FromError, use From instead This removes the FromError trait, since it can now be expressed using the new convert::Into trait. All implementations of FromError where changed to From, 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] --- src/liballoc/boxed.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/liballoc') 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 DoubleEndedIterator for Box { impl ExactSizeIterator for Box {} #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, E: Error + 'a> FromError for Box { - fn from_error(err: E) -> Box { +impl<'a, E: Error + 'a> From for Box { + fn from(err: E) -> Box { Box::new(err) } } -- cgit 1.4.1-3-g733a5