- Use `Error::source` instead of `Error::cause`.
- Remove unused import.
This commit is contained in:
Toralf Wittner
2018-12-20 13:41:11 +01:00
committed by GitHub
parent f541df391a
commit 6be3aca768
2 changed files with 4 additions and 4 deletions

View File

@ -47,10 +47,10 @@ where
A: fmt::Debug + std::error::Error,
B: fmt::Debug + std::error::Error
{
fn cause(&self) -> Option<&dyn std::error::Error> {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match self {
EitherError::A(a) => a.cause(),
EitherError::B(b) => b.cause()
EitherError::A(a) => a.source(),
EitherError::B(b) => b.source()
}
}
}