use crate::How; mod private { use crate::How; #[doc(hidden)] pub trait IntoResultHow: Sized { type T; fn into_result_how(self) -> Result; } } pub(crate) use private::IntoResultHow; impl IntoResultHow for Result where E: std::error::Error, { type T = T; #[inline] fn into_result_how(self) -> Result { self.map_err(|e| How::new(e.to_string())) } } impl IntoResultHow for Result { type T = T; #[inline(always)] fn into_result_how(self) -> Result { self } }