@@ -604,10 +604,10 @@ impl<T: 'static> LocalKey<RefCell<T>> {
604
604
/// static X: RefCell<Vec<i32>> = RefCell::new(Vec::new());
605
605
/// }
606
606
///
607
- /// X.with_ref (|v| assert!(v.is_empty()));
607
+ /// X.with_borrow (|v| assert!(v.is_empty()));
608
608
/// ```
609
609
#[ unstable( feature = "local_key_cell_methods" , issue = "none" ) ]
610
- pub fn with_ref < F , R > ( & ' static self , f : F ) -> R
610
+ pub fn with_borrow < F , R > ( & ' static self , f : F ) -> R
611
611
where
612
612
F : FnOnce ( & T ) -> R ,
613
613
{
@@ -636,12 +636,12 @@ impl<T: 'static> LocalKey<RefCell<T>> {
636
636
/// static X: RefCell<Vec<i32>> = RefCell::new(Vec::new());
637
637
/// }
638
638
///
639
- /// X.with_mut (|v| v.push(1));
639
+ /// X.with_borrow_mut (|v| v.push(1));
640
640
///
641
- /// X.with_ref (|v| assert_eq!(*v, vec![1]));
641
+ /// X.with_borrow (|v| assert_eq!(*v, vec![1]));
642
642
/// ```
643
643
#[ unstable( feature = "local_key_cell_methods" , issue = "none" ) ]
644
- pub fn with_mut < F , R > ( & ' static self , f : F ) -> R
644
+ pub fn with_borrow_mut < F , R > ( & ' static self , f : F ) -> R
645
645
where
646
646
F : FnOnce ( & mut T ) -> R ,
647
647
{
@@ -673,7 +673,7 @@ impl<T: 'static> LocalKey<RefCell<T>> {
673
673
///
674
674
/// X.set(vec![1, 2, 3]); // But X.set() is fine, as it skips the initializer above.
675
675
///
676
- /// X.with_ref (|v| assert_eq!(*v, vec![1, 2, 3]));
676
+ /// X.with_borrow (|v| assert_eq!(*v, vec![1, 2, 3]));
677
677
/// ```
678
678
#[ unstable( feature = "local_key_cell_methods" , issue = "none" ) ]
679
679
pub fn set ( & ' static self , value : T ) {
@@ -706,13 +706,13 @@ impl<T: 'static> LocalKey<RefCell<T>> {
706
706
/// static X: RefCell<Vec<i32>> = RefCell::new(Vec::new());
707
707
/// }
708
708
///
709
- /// X.with_mut (|v| v.push(1));
709
+ /// X.with_borrow_mut (|v| v.push(1));
710
710
///
711
711
/// let a = X.take();
712
712
///
713
713
/// assert_eq!(a, vec![1]);
714
714
///
715
- /// X.with_ref (|v| assert!(v.is_empty()));
715
+ /// X.with_borrow (|v| assert!(v.is_empty()));
716
716
/// ```
717
717
#[ unstable( feature = "local_key_cell_methods" , issue = "none" ) ]
718
718
pub fn take ( & ' static self ) -> T
@@ -744,7 +744,7 @@ impl<T: 'static> LocalKey<RefCell<T>> {
744
744
/// let prev = X.replace(vec![1, 2, 3]);
745
745
/// assert!(prev.is_empty());
746
746
///
747
- /// X.with_ref (|v| assert_eq!(*v, vec![1, 2, 3]));
747
+ /// X.with_borrow (|v| assert_eq!(*v, vec![1, 2, 3]));
748
748
/// ```
749
749
#[ unstable( feature = "local_key_cell_methods" , issue = "none" ) ]
750
750
pub fn replace ( & ' static self , value : T ) -> T {
0 commit comments