diff options
| author | Dirk Van Haerenborgh <vhdirk@gmail.com> | 2018-12-13 06:37:06 +0100 |
|---|---|---|
| committer | Dirk Van Haerenborgh <vhdirk@gmail.com> | 2018-12-13 06:37:06 +0100 |
| commit | 6060d6ac929cf092f9a7455915dba3bab4848b9f (patch) | |
| tree | af41f5b67f4538963501aef9082bb2d1427a162e /src/error.rs | |
| parent | c3d26cd116b51687b2fa43a22d3d0c2856cb093b (diff) | |
| parent | b20e8bffb4165d378d8d8703628913c3cb86ed4f (diff) | |
| download | mail-6060d6ac929cf092f9a7455915dba3bab4848b9f.tar.gz | |
Merge branch 'eaon-edition-2018'
Diffstat (limited to 'src/error.rs')
| -rw-r--r-- | src/error.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/error.rs b/src/error.rs index 6de4236..3eba2ba 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,7 +1,7 @@ use std; use std::{error, fmt, io, result}; -use ffi; +use crate::ffi; pub type Result<T> = result::Result<T, Error>; @@ -13,24 +13,24 @@ pub enum Error { } impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}", error::Error::description(self)) } } impl std::error::Error for Error { fn description(&self) -> &str { - match *self { - Error::IoError(ref e) => error::Error::description(e), - Error::NotmuchError(ref e) => e.description(), + match self { + Error::IoError(e) => error::Error::description(e), + Error::NotmuchError(e) => e.description(), Error::UnspecifiedError => "Generic notmuch error", } } - fn cause(&self) -> Option<&error::Error> { - match *self { - Error::IoError(ref e) => Some(e), - Error::NotmuchError(ref e) => Some(e), + fn cause(&self) -> Option<&dyn error::Error> { + match self { + Error::IoError(e) => Some(e), + Error::NotmuchError(e) => Some(e), Error::UnspecifiedError => None, } } |
