use std::any::Any;
use std::panic;
pub(crate) trait UnwrapOrThrow<T> {
fn unwrap_or_throw(self) -> T;
}
impl<T, E> UnwrapOrThrow<T> for Result<T, E>
where
E: 'static + Any + Send,
{
fn unwrap_or_throw(self) -> T {
match self {
Ok(v) => v,
Err(e) => panic::panic_any(e),
}
}
}