add Error::source
This commit is contained in:
parent
278de79267
commit
ed2b92f98b
@ -86,6 +86,14 @@ impl error::Error for Error {
|
|||||||
Error::Utf8(ref err) => Some(err),
|
Error::Utf8(ref err) => Some(err),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The lower-level source of this error, in the case of a `Utf8` error.
|
||||||
|
fn source(&self) -> Option<&(dyn error::Error + 'static)> {
|
||||||
|
match *self {
|
||||||
|
Error::Custom(_) => None,
|
||||||
|
Error::Utf8(ref err) => Some(err),
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ser::Error for Error {
|
impl ser::Error for Error {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user