pub struct PanicError; use std::fmt; impl From for PanicError where E: fmt::Debug, { fn from(e: E) -> Self { panic!("{:?}", e) } } pub fn unwrap(r: Result) -> T { if let Ok(t) = r { t } else { unreachable!(); } }