diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2017-09-03 13:53:55 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2017-09-03 15:42:06 +0200 |
commit | 603808a9faba93bc1dea8a5004ffc402e2630a5d (patch) | |
tree | 1b0f0ea3718854fa54ad1c309383c32747cf7e79 /lib/domain/libimagmail | |
parent | 9713a4632ca2c52af4fab392bd6c479b4ac7db1a (diff) |
Impl IntoError for error kinds
Diffstat (limited to 'lib/domain/libimagmail')
-rw-r--r-- | lib/domain/libimagmail/src/error.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/domain/libimagmail/src/error.rs b/lib/domain/libimagmail/src/error.rs index 19a67fd6..65eb2b31 100644 --- a/lib/domain/libimagmail/src/error.rs +++ b/lib/domain/libimagmail/src/error.rs @@ -47,3 +47,14 @@ pub use self::error::MailError; pub use self::error::MailErrorKind; pub use self::error::MapErrInto; +impl IntoError for MailErrorKind { + type Target = MailError; + + fn into_error(self) -> Self::Target { + MailError::from_kind(self) + } + + fn into_error_with_cause(self, cause: Box<Error>) -> Self::Target { + MailError::from_kind(self) + } +} |