diff --git a/src/error.rs b/src/error.rs index dd90173..ae2a6d8 100644 --- a/src/error.rs +++ b/src/error.rs @@ -133,19 +133,7 @@ impl From for io::Error { } } -impl StdError for Error { - fn source(&self) -> Option<&(dyn StdError + 'static)> { - match *self.0 { - ErrorKind::Io(ref err) => Some(err), - ErrorKind::Utf8 { ref err, .. } => Some(err), - ErrorKind::UnequalLengths { .. } => None, - ErrorKind::Seek => None, - ErrorKind::Serialize(_) => None, - ErrorKind::Deserialize { ref err, .. } => Some(err), - _ => unreachable!(), - } - } -} +impl StdError for Error {} impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { @@ -333,11 +321,7 @@ impl IntoInnerError { } } -impl StdError for IntoInnerError { - fn source(&self) -> Option<&(dyn StdError + 'static)> { - self.err.source() - } -} +impl StdError for IntoInnerError {} impl fmt::Display for IntoInnerError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {