diff options
| author | 许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com> | 2024-12-18 22:56:58 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-18 22:56:58 +0800 |
| commit | fbb9e692262f5d218fba6fe4de69164183c4af5c (patch) | |
| tree | 65447203e70b74510fb4552f422f8e28a5371e55 | |
| parent | 88428f4dc3a66e25d25ce4d69824c84a013db7ac (diff) | |
| parent | 20bff638bf45990b7d71cdc330b4f68bd4b4bc73 (diff) | |
| download | rust-fbb9e692262f5d218fba6fe4de69164183c4af5c.tar.gz rust-fbb9e692262f5d218fba6fe4de69164183c4af5c.zip | |
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.
| -rw-r--r-- | library/core/src/cell/lazy.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/core/src/cell/lazy.rs b/library/core/src/cell/lazy.rs index 5ac33516684..84cbbc71f40 100644 --- a/library/core/src/cell/lazy.rs +++ b/library/core/src/cell/lazy.rs @@ -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 /// |
