summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBotahamec <botahamec@outlook.com>2022-10-23 13:17:29 -0400
committerBotahamec <botahamec@outlook.com>2022-10-23 13:17:29 -0400
commit42d51b88069a4f534633d90c01d46db59d458652 (patch)
tree912911dc8e98e175bdcd351b9821637ac97aa0ec /src
parentd53d540ce53a2b76233b40a05f9980a084146d92 (diff)
Implement Error for Exun<E, RawUnexpected>
Diffstat (limited to 'src')
-rw-r--r--src/exun.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/exun.rs b/src/exun.rs
index 5f6bb43..5e9a8e0 100644
--- a/src/exun.rs
+++ b/src/exun.rs
@@ -40,6 +40,16 @@ impl<E: Error + 'static, U: Error + 'static> Error for Exun<E, U> {
}
#[cfg(feature = "std")]
+impl<E: Error + 'static> Error for Exun<E, RawUnexpected> {
+ fn source(&self) -> Option<&(dyn Error + 'static)> {
+ match self {
+ Expected(ref e) => Some(e),
+ Unexpected(ref u) => u.source(),
+ }
+ }
+}
+
+#[cfg(feature = "std")]
impl<E: Error, U> From<E> for Exun<E, U> {
fn from(e: E) -> Self {
Expected(e)