|
115 | 115 | //! let shared_map: Rc<RefCell<_>> = Rc::new(RefCell::new(HashMap::new())); |
116 | 116 | //! // Create a new block to limit the scope of the dynamic borrow |
117 | 117 | //! { |
118 | | -//! let mut map: RefMut<_> = shared_map.borrow_mut(); |
| 118 | +//! let mut map: RefMut<'_, _> = shared_map.borrow_mut(); |
119 | 119 | //! map.insert("africa", 92388); |
120 | 120 | //! map.insert("kyoto", 11837); |
121 | 121 | //! map.insert("piccadilly", 11826); |
@@ -1435,8 +1435,8 @@ impl<'b, T: ?Sized> Ref<'b, T> { |
1435 | 1435 | /// use std::cell::{RefCell, Ref}; |
1436 | 1436 | /// |
1437 | 1437 | /// let c = RefCell::new((5, 'b')); |
1438 | | - /// let b1: Ref<(u32, char)> = c.borrow(); |
1439 | | - /// let b2: Ref<u32> = Ref::map(b1, |t| &t.0); |
| 1438 | + /// let b1: Ref<'_, (u32, char)> = c.borrow(); |
| 1439 | + /// let b2: Ref<'_, u32> = Ref::map(b1, |t| &t.0); |
1440 | 1440 | /// assert_eq!(*b2, 5) |
1441 | 1441 | /// ``` |
1442 | 1442 | #[stable(feature = "cell_map", since = "1.8.0")] |
@@ -1464,8 +1464,8 @@ impl<'b, T: ?Sized> Ref<'b, T> { |
1464 | 1464 | /// use std::cell::{RefCell, Ref}; |
1465 | 1465 | /// |
1466 | 1466 | /// let c = RefCell::new(vec![1, 2, 3]); |
1467 | | - /// let b1: Ref<Vec<u32>> = c.borrow(); |
1468 | | - /// let b2: Result<Ref<u32>, _> = Ref::filter_map(b1, |v| v.get(1)); |
| 1467 | + /// let b1: Ref<'_, Vec<u32>> = c.borrow(); |
| 1468 | + /// let b2: Result<Ref<'_, u32>, _> = Ref::filter_map(b1, |v| v.get(1)); |
1469 | 1469 | /// assert_eq!(*b2.unwrap(), 2); |
1470 | 1470 | /// ``` |
1471 | 1471 | #[stable(feature = "cell_filter_map", since = "1.63.0")] |
@@ -1577,8 +1577,8 @@ impl<'b, T: ?Sized> RefMut<'b, T> { |
1577 | 1577 | /// |
1578 | 1578 | /// let c = RefCell::new((5, 'b')); |
1579 | 1579 | /// { |
1580 | | - /// let b1: RefMut<(u32, char)> = c.borrow_mut(); |
1581 | | - /// let mut b2: RefMut<u32> = RefMut::map(b1, |t| &mut t.0); |
| 1580 | + /// let b1: RefMut<'_, (u32, char)> = c.borrow_mut(); |
| 1581 | + /// let mut b2: RefMut<'_, u32> = RefMut::map(b1, |t| &mut t.0); |
1582 | 1582 | /// assert_eq!(*b2, 5); |
1583 | 1583 | /// *b2 = 42; |
1584 | 1584 | /// } |
@@ -1612,8 +1612,8 @@ impl<'b, T: ?Sized> RefMut<'b, T> { |
1612 | 1612 | /// let c = RefCell::new(vec![1, 2, 3]); |
1613 | 1613 | /// |
1614 | 1614 | /// { |
1615 | | - /// let b1: RefMut<Vec<u32>> = c.borrow_mut(); |
1616 | | - /// let mut b2: Result<RefMut<u32>, _> = RefMut::filter_map(b1, |v| v.get_mut(1)); |
| 1615 | + /// let b1: RefMut<'_, Vec<u32>> = c.borrow_mut(); |
| 1616 | + /// let mut b2: Result<RefMut<'_, u32>, _> = RefMut::filter_map(b1, |v| v.get_mut(1)); |
1617 | 1617 | /// |
1618 | 1618 | /// if let Ok(mut b2) = b2 { |
1619 | 1619 | /// *b2 += 2; |
|
0 commit comments