#[diagnostic::on_unimplemented( message = "this is a helper for [Option, Result].", label = "you might want collect_array_checked" )] #[doc(hidden)] pub trait Maybe { type Unwrap; type Or; fn asr(self) -> Result; } impl Maybe for Option { type Unwrap = T; type Or = (); fn asr(self) -> Result { self.ok_or(()) } } impl Maybe for Result { type Unwrap = T; type Or = E; fn asr(self) -> Result { self } }