Merge #64
64: Add Error::source r=nox a=AnderEnder As discussed in https://github.com/nox/serde_urlencoded/pull/63 `Error::source` was added in `1.30.0` This PR implements `Error::source` Co-authored-by: Andrii Radyk <ander.ender@gmail.com>
This commit is contained in:
commit
bf16076bce
@ -86,6 +86,14 @@ impl error::Error for Error {
|
||||
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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user