use std::convert::Infallible; pub trait InfallibleExt { type Inner; fn infallible(self) -> Self::Inner; } impl InfallibleExt for Result { type Inner = T; fn infallible(self) -> T { self.expect("infallible") } }