diff --git a/src/libstd/option.rs b/src/libstd/option.rs index 9b6d0a77cd8..42878f6effb 100644 --- a/src/libstd/option.rs +++ b/src/libstd/option.rs @@ -467,15 +467,6 @@ pub fn unwrap_or_default(self) -> T { None => Default::default() } } - - /// Returns self or `Some`-wrapped default value - #[inline] - pub fn or_default(self) -> Option { - match self { - None => Some(Default::default()), - x => x, - } - } } impl Default for Option { @@ -483,7 +474,7 @@ impl Default for Option { fn default() -> Option { None } } -impl Option { +impl Option { /// Returns the contained value or zero (for this type) #[inline] pub fn unwrap_or_zero(self) -> T { @@ -492,15 +483,6 @@ pub fn unwrap_or_zero(self) -> T { None => Zero::zero() } } - - /// Returns self or `Some`-wrapped zero value - #[inline] - pub fn or_zero(self) -> Option { - match self { - None => Some(Zero::zero()), - x => x - } - } } /// An iterator that yields either one or zero elements