summaryrefslogtreecommitdiff
path: root/src/exun.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/exun.rs')
-rw-r--r--src/exun.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/exun.rs b/src/exun.rs
index 5e9a8e0..c54f9be 100644
--- a/src/exun.rs
+++ b/src/exun.rs
@@ -5,6 +5,7 @@ use std::error::Error;
#[cfg(feature = "alloc")]
use crate::RawUnexpected;
+use crate::UnexpectedError;
pub use Exun::{Expected, Unexpected};
@@ -63,6 +64,13 @@ impl<E> From<RawUnexpected> for Exun<E, RawUnexpected> {
}
}
+#[cfg(feature = "alloc")]
+impl<E> From<RawUnexpected> for Exun<E, UnexpectedError> {
+ fn from(ue: RawUnexpected) -> Self {
+ Unexpected(ue.into())
+ }
+}
+
impl<E, U> Exun<E, U> {
/// Converts from `Expect<E, U>` to [`Option<E>`].
///