Skip to content

Commit

Permalink
Merge pull request #28 from AnderEnder/remove-deprecated-error-descri…
Browse files Browse the repository at this point in the history
…ption

Remove deprecated Error::description
  • Loading branch information
gentoo90 authored Jan 4, 2020
2 parents 6ccc1e0 + 64735f0 commit b7f8b41
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
11 changes: 1 addition & 10 deletions src/decoder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<io::Error> for DecoderError {
fn from(err: io::Error) -> DecoderError {
Expand Down
11 changes: 1 addition & 10 deletions src/encoder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> = Result<T, EncoderError>;

Expand Down

0 comments on commit b7f8b41

Please sign in to comment.