RefCell::borrow_mut example should demonstrate mut
This commit is contained in:
parent
62a3a6ecc0
commit
a19353643b
@ -414,7 +414,9 @@ impl<T: ?Sized> RefCell<T> {
|
||||
///
|
||||
/// let c = RefCell::new(5);
|
||||
///
|
||||
/// let borrowed_five = c.borrow_mut();
|
||||
/// *c.borrow_mut() = 7;
|
||||
///
|
||||
/// assert_eq!(*c.borrow(), 7);
|
||||
/// ```
|
||||
///
|
||||
/// An example of panic:
|
||||
|
Loading…
Reference in New Issue
Block a user