fp_core/extract.rs
1pub trait Extract<A> {
2 fn extract(self) -> A;
3}
4
5impl<A> Extract<A> for Option<A> {
6 fn extract(self) -> A {
7 self.unwrap() // is there a better way to achieve this?
8 }
9}
10
11impl<A, E> Extract<A> for Result<A, E> where E: std::fmt::Debug {
12 fn extract(self) -> A {
13 self.unwrap() // is there a better way to achieve this?
14 }
15}