Alter std::cell::Cell::get_mut documentation

I find this more consistent with RefCell's equivalent method.
This commit is contained in:
Rupert Rutledge 2021-06-17 11:02:16 +01:00
parent cb3c4ee718
commit 7cadf7bc01

View file

@ -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
///
/// ```