corrected Cell<T> module level doc

replaced `&mut T` with `&T` to finally state
"a &T to the inner value can never be obtained"
This commit is contained in:
matwatson 2025-09-21 14:14:29 -07:00 committed by mat
parent 7e4b8d702f
commit d056f59704

View file

@ -27,10 +27,9 @@
//!
//! ## `Cell<T>`
//!
//! [`Cell<T>`] implements interior mutability by moving values in and out of the cell. That is, an
//! `&mut T` to the inner value can never be obtained, and the value itself cannot be directly
//! obtained without replacing it with something else. Both of these rules ensure that there is
//! never more than one reference pointing to the inner value. This type provides the following
//! [`Cell<T>`] implements interior mutability by moving values in and out of the cell. That is, a
//! `&T` to the inner value can never be obtained, and the value itself cannot be directly
//! obtained without replacing it with something else. This type provides the following
//! methods:
//!
//! - For types that implement [`Copy`], the [`get`](Cell::get) method retrieves the current