summaryrefslogtreecommitdiff
path: root/src/exun.rs
diff options
context:
space:
mode:
authorBotahamec <botahamec@outlook.com>2022-10-23 13:25:43 -0400
committerBotahamec <botahamec@outlook.com>2022-10-23 13:25:43 -0400
commitf4b5e2afc59a30687a0630504e233ecb63339783 (patch)
tree8a2066f19ec1615d21c7ed26ed7f061422a072e3 /src/exun.rs
parent42d51b88069a4f534633d90c01d46db59d458652 (diff)
impl From<Raw> for Exun<E, UnexpectedError>
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>`].
///