about summary refs log tree commit diff
path: root/src/libserialize/json.rs
diff options
context:
space:
mode:
authorSean McArthur <sean.monstar@gmail.com>2015-03-30 17:56:48 -0700
committerSean McArthur <sean.monstar@gmail.com>2015-03-30 18:08:58 -0700
commite17f4fc1d4545f5c17b21805c5145b05495484ee (patch)
tree73738e0f820177de7d6052ad15e01c868d7a24ae /src/libserialize/json.rs
parent9de34a84bb300bab1bf0227f577331620cd60511 (diff)
downloadrust-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/libserialize/json.rs')
-rw-r--r--src/libserialize/json.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs
index f6f059f7210..cd7f66f50c8 100644
--- a/src/libserialize/json.rs
+++ b/src/libserialize/json.rs
@@ -365,8 +365,8 @@ impl std::error::Error for EncoderError {
     fn description(&self) -> &str { "encoder error" }
 }
 
-impl std::error::FromError<fmt::Error> for EncoderError {
-    fn from_error(err: fmt::Error) -> EncoderError { EncoderError::FmtError(err) }
+impl From<fmt::Error> for EncoderError {
+    fn from(err: fmt::Error) -> EncoderError { EncoderError::FmtError(err) }
 }
 
 pub type EncodeResult = Result<(), EncoderError>;