use OptionExt; impl OptionExt for Option { fn contains(&self, x: &U) -> bool where U: PartialEq { match *self { Some(ref y) => x == y, None => false, } } #[inline] fn map_or2 U>(self, f: F, default: U) -> U { self.map_or(default, f) } #[inline] fn map_or_else2 U, D: FnOnce() -> U>(self, f: F, default: D) -> U { self.map_or_else(default, f) } }