diff --git a/src/decoder/mod.rs b/src/decoder/mod.rs index d752419..66c67eb 100644 --- a/src/decoder/mod.rs +++ b/src/decoder/mod.rs @@ -51,16 +51,7 @@ impl fmt::Display for DecoderError { } } -impl Error for DecoderError { - fn description(&self) -> &str { - use self::DecoderError::*; - match *self { - DecodeNotImplemented(ref s) | DeserializerError(ref s) | ParseError(ref s) => s, - IoError(ref e) => e.description(), - NoFieldName => "No field name", - } - } -} +impl Error for DecoderError {} impl From for DecoderError { fn from(err: io::Error) -> DecoderError { diff --git a/src/encoder/mod.rs b/src/encoder/mod.rs index 1297fdb..ba154c6 100644 --- a/src/encoder/mod.rs +++ b/src/encoder/mod.rs @@ -46,16 +46,7 @@ impl fmt::Display for EncoderError { } } -impl Error for EncoderError { - fn description(&self) -> &str { - use self::EncoderError::*; - match *self { - EncodeNotImplemented(ref s) | SerializerError(ref s) => s, - IoError(ref e) => e.description(), - NoFieldName => "No field name", - } - } -} +impl Error for EncoderError {} pub type EncodeResult = Result;