Skip to content

Commit

Permalink
Alter std::cell::Cell::get_mut documentation
Browse files Browse the repository at this point in the history
I find this more consistent with RefCell's equivalent method.
  • Loading branch information
Eosis committed Jun 17, 2021
1 parent cb3c4ee commit 7cadf7b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions library/core/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
/// ```
Expand Down

0 comments on commit 7cadf7b

Please sign in to comment.