summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-03-07 18:57:42 +0100
committerMatthias Beyer <mail@beyermatthias.de>2020-03-08 11:43:43 +0100
commit666193dfc26181b6606cb85de5389c4ed6ece5eb (patch)
tree6e5a8e08e5b204f202de335d412de3f69196ce12
parente59df7655443f923984d3f4e2728adac0008a63f (diff)
Implement Into<anyhow::Error> for Error
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--lib/entry/libimagentryview/src/error.rs9
-rw-r--r--lib/entry/libimagentryview/src/viewer.rs2
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/entry/libimagentryview/src/error.rs b/lib/entry/libimagentryview/src/error.rs
index be887549..5f45d7a0 100644
--- a/lib/entry/libimagentryview/src/error.rs
+++ b/lib/entry/libimagentryview/src/error.rs
@@ -46,3 +46,12 @@ impl From<::anyhow::Error> for Error {
}
}
+impl Into<::anyhow::Error> for Error {
+ fn into(self) -> ::anyhow::Error {
+ match self {
+ Error::Io(e) => ::anyhow::Error::from(e),
+ Error::Other(e) => e,
+ }
+ }
+}
+
diff --git a/lib/entry/libimagentryview/src/viewer.rs b/lib/entry/libimagentryview/src/viewer.rs
index 5341e7ab..f4a9b3e0 100644
--- a/lib/entry/libimagentryview/src/viewer.rs
+++ b/lib/entry/libimagentryview/src/viewer.rs
@@ -140,7 +140,7 @@ impl<'a, I, V, W, F, T> Iterator for ViewIter<'a, I, V, W, F, T>
}
}
- return Some(Err(Error::from(e)))
+ return Some(Err(e))
}
}