use super::*; #[derive(Clone, Copy)] pub struct OkInner; #[allow(non_upper_case_globals)] pub const _Ok: Prism = Prism(OkInner); impl PrismPreview> for OkInner { type Field = T; fn preview(&self, thing: Result) -> Option { thing.ok() } fn review(&self, thing: Self::Field) -> Result { Ok(thing) } } #[derive(Clone, Copy)] pub struct ErrInner; #[allow(non_upper_case_globals)] pub const _Err: Prism = Prism(ErrInner); impl PrismPreview> for ErrInner { type Field = E; fn preview(&self, thing: Result) -> Option { thing.err() } fn review(&self, thing: Self::Field) -> Result { Err(thing) } }