Rollup merge of #134452 - jalil-salame:fix-lazy-cell-docs, r=tgross35

fix(LazyCell): documentation of get[_mut] was wrong

- `LazyCell::get`: said it was returning a **mutable** reference.
- `LazyCell::get_mut`: said it was returning a reference (the mutable was missing).

Related to #129333 (`lazy_get`). `LazyLock`'s documentation was correct.
This commit is contained in:
许杰友 Jieyou Xu (Joe) 2024-12-18 22:56:58 +08:00 committed by GitHub
commit fbb9e69226
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -219,7 +219,7 @@ impl<T, F: FnOnce() -> T> LazyCell<T, F> {
}
impl<T, F> LazyCell<T, F> {
/// Returns a reference to the value if initialized, or `None` if not.
/// Returns a mutable reference to the value if initialized, or `None` if not.
///
/// # Examples
///
@ -245,7 +245,7 @@ impl<T, F> LazyCell<T, F> {
}
}
/// Returns a mutable reference to the value if initialized, or `None` if not.
/// Returns a reference to the value if initialized, or `None` if not.
///
/// # Examples
///