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/etc/libimaginteraction/src | |
parent | 9713a4632ca2c52af4fab392bd6c479b4ac7db1a (diff) |
Impl IntoError for error kinds
Diffstat (limited to 'lib/etc/libimaginteraction/src')
-rw-r--r-- | lib/etc/libimaginteraction/src/error.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/etc/libimaginteraction/src/error.rs b/lib/etc/libimaginteraction/src/error.rs index b54c54a4..271bf832 100644 --- a/lib/etc/libimaginteraction/src/error.rs +++ b/lib/etc/libimaginteraction/src/error.rs @@ -85,3 +85,14 @@ pub use self::error::InteractionError; pub use self::error::InteractionErrorKind; pub use self::error::MapErrInto; +impl IntoError for InteractionErrorKind { + type Target = InteractionError; + + fn into_error(self) -> Self::Target { + InteractionError::from_kind(self) + } + + fn into_error_with_cause(self, cause: Box<Error>) -> Self::Target { + InteractionError::from_kind(self) + } +} |