Skip to content

Commit c124668

Browse files
committed
feat(mimic): Allow converting errors
1 parent 9a4086d commit c124668

File tree

1 file changed

+9
-0
lines changed
  • crates/libtest2-mimic/src

1 file changed

+9
-0
lines changed

crates/libtest2-mimic/src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,15 @@ impl RunError {
189189
}
190190
}
191191

192+
impl<E> From<E> for RunError
193+
where
194+
E: std::error::Error + Send + Sync + 'static,
195+
{
196+
fn from(error: E) -> Self {
197+
Self::with_cause(error)
198+
}
199+
}
200+
192201
pub struct RunContext<'t> {
193202
inner: &'t libtest2_harness::TestContext,
194203
}

0 commit comments

Comments
 (0)