File tree 1 file changed +1
-19
lines changed
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> {
581
581
#[ inline]
582
582
#[ unstable( feature = "option_insert" , reason = "new API" , issue = "none" ) ]
583
583
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) ;
603
585
604
586
match * self {
605
587
Some ( ref mut v) => v,
You can’t perform that action at this time.
0 commit comments