diff options
Diffstat (limited to 'src/exun.rs')
| -rw-r--r-- | src/exun.rs | 10 |
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) |
