File tree Expand file tree Collapse file tree 1 file changed +1
-19
lines changed
Expand file tree Collapse file tree 1 file changed +1
-19
lines changed Original file line number Diff line number Diff line change @@ -581,25 +581,7 @@ impl<T> Option<T> {
581581 #[ inline]
582582 #[ unstable( feature = "option_insert" , reason = "new API" , issue = "none" ) ]
583583 pub fn insert ( & mut self , v : T ) -> & mut T {
584- self . insert_with ( || v)
585- }
586-
587- /// Inserts a value computed from `f` into the option, then returns a
588- /// mutable reference to the contained value.
589- ///
590- /// # Example
591- ///
592- /// ```
593- /// #![feature(option_insert)]
594- ///
595- /// let mut o = None;
596- /// let v = o.insert_with(|| 3);
597- /// assert_eq!(*v, 3);
598- /// ```
599- #[ inline]
600- #[ unstable( feature = "option_insert" , reason = "new API" , issue = "none" ) ]
601- pub fn insert_with < F : FnOnce ( ) -> T > ( & mut self , f : F ) -> & mut T {
602- * self = Some ( f ( ) ) ;
584+ * self = Some ( v) ;
603585
604586 match * self {
605587 Some ( ref mut v) => v,
You can’t perform that action at this time.
0 commit comments