@@ -566,8 +566,7 @@ impl<T> Option<T> {
566
566
// Setting a new value
567
567
/////////////////////////////////////////////////////////////////////////
568
568
569
- /// Inserts `v` into the option then returns a mutable reference
570
- /// to the contained value.
569
+ /// Inserts `value` into the option then returns a mutable reference to it.
571
570
///
572
571
/// # Example
573
572
///
@@ -585,8 +584,8 @@ impl<T> Option<T> {
585
584
/// ```
586
585
#[ inline]
587
586
#[ unstable( feature = "option_insert" , reason = "newly added" , issue = "none" ) ]
588
- pub fn insert ( & mut self , val : T ) -> & mut T {
589
- * self = Some ( val ) ;
587
+ pub fn insert ( & mut self , value : T ) -> & mut T {
588
+ * self = Some ( value ) ;
590
589
591
590
match self {
592
591
Some ( v) => v,
@@ -825,7 +824,7 @@ impl<T> Option<T> {
825
824
// Entry-like operations to insert if None and return a reference
826
825
/////////////////////////////////////////////////////////////////////////
827
826
828
- /// Inserts `v ` into the option if it is [`None`], then
827
+ /// Inserts `value ` into the option if it is [`None`], then
829
828
/// returns a mutable reference to the contained value.
830
829
///
831
830
/// # Examples
@@ -844,12 +843,12 @@ impl<T> Option<T> {
844
843
/// ```
845
844
#[ inline]
846
845
#[ stable( feature = "option_entry" , since = "1.20.0" ) ]
847
- pub fn get_or_insert ( & mut self , val : T ) -> & mut T {
848
- self . get_or_insert_with ( || val )
846
+ pub fn get_or_insert ( & mut self , value : T ) -> & mut T {
847
+ self . get_or_insert_with ( || value )
849
848
}
850
849
851
- /// Inserts a value computed from `f` into the option if it is [`None`], then
852
- /// returns a mutable reference to the contained value.
850
+ /// Inserts a value computed from `f` into the option if it is [`None`],
851
+ /// then returns a mutable reference to the contained value.
853
852
///
854
853
/// # Examples
855
854
///
0 commit comments