diff --git a/crates/async-dropper/src/lib.rs b/crates/async-dropper/src/lib.rs index 8c8282e..bf77823 100644 --- a/crates/async-dropper/src/lib.rs +++ b/crates/async-dropper/src/lib.rs @@ -130,3 +130,16 @@ pub trait AsyncDrop: Default + PartialEq + Eq + ResetDefault { DropFailAction::Continue } } + +// Create an impl for AsyncDropError to allow ? to be used with AsyncDropError +impl From> for AsyncDropError { + fn from(value: Box) -> Self { + AsyncDropError::UnexpectedError(value) + } +} +// Create a impl for anyhow::Error to allow ? to be used with AsyncDropError +impl From for AsyncDropError { + fn from(value: anyhow::Error) -> Self { + AsyncDropError::UnexpectedError(Box::new(value)) + } +}