1 2 3 4 5 6 7 8 9
pub trait Extract<A> { fn extract(self) -> A; } impl<A> Extract<A> for Option<A> { fn extract(self) -> A { self.unwrap() // is there a better way to achieve this? } }
1 2 3 4 5 6 7 8 9
pub trait Extract<A> { fn extract(self) -> A; } impl<A> Extract<A> for Option<A> { fn extract(self) -> A { self.unwrap() // is there a better way to achieve this? } }