diff options
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, } } |
