Alter std::cell::Cell::get_mut documentation
I find this more consistent with RefCell's equivalent method.
This commit is contained in:
parent
cb3c4ee718
commit
7cadf7bc01
@ -488,6 +488,13 @@ impl<T: ?Sized> Cell<T> {
|
||||
/// This call borrows `Cell` mutably (at compile-time) which guarantees
|
||||
/// that we possess the only reference.
|
||||
///
|
||||
/// However be cautious: this method expects `self` to be mutable, which is
|
||||
/// generally not the case when using a `Cell`. If you require interior
|
||||
/// mutability by reference, consider using `RefCell` which provides
|
||||
/// run-time checked mutable borrows through its [`borrow_mut`] method.
|
||||
///
|
||||
/// [`borrow_mut`]: RefCell::borrow_mut()
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
|
Loading…
x
Reference in New Issue
Block a user