~matthiasbeyer/maildir

ad3b3ce409950624c4097b12b9d887cd50756c48 — Andreas Rottmann 2 years ago 4e8a752
Modernize `Error` trait implementations

Implement the newer, more flexible `source()` instead of
`cause()`. This also eliminates a deprecation warning regarding
missing `dyn` keywords on nightly.
1 files changed, 2 insertions(+), 2 deletions(-)

M src/lib.rs
M src/lib.rs => src/lib.rs +2 -2
@@ 36,7 36,7 @@ impl error::Error for MailEntryError {
        }
    }

    fn cause(&self) -> Option<&error::Error> {
    fn source(&self) -> Option<&(dyn error::Error + 'static)> {
        match *self {
            MailEntryError::IOError(ref err) => Some(err),
            MailEntryError::ParseError(ref err) => Some(err),


@@ 266,7 266,7 @@ impl error::Error for MaildirError {
        }
    }

    fn cause(&self) -> Option<&error::Error> {
    fn source(&self) -> Option<&(dyn error::Error + 'static)> {
        use MaildirError::*;

        match *self {