Skip to content
/ rust Public
forked from rust-lang/rust

Commit fbb9e69

Browse files
authored
Rollup merge of rust-lang#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 rust-lang#129333 (`lazy_get`). `LazyLock`'s documentation was correct.
2 parents 88428f4 + 20bff63 commit fbb9e69

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: library/core/src/cell/lazy.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ impl<T, F: FnOnce() -> T> LazyCell<T, F> {
219219
}
220220

221221
impl<T, F> LazyCell<T, F> {
222-
/// Returns a reference to the value if initialized, or `None` if not.
222+
/// Returns a mutable reference to the value if initialized, or `None` if not.
223223
///
224224
/// # Examples
225225
///
@@ -245,7 +245,7 @@ impl<T, F> LazyCell<T, F> {
245245
}
246246
}
247247

248-
/// Returns a mutable reference to the value if initialized, or `None` if not.
248+
/// Returns a reference to the value if initialized, or `None` if not.
249249
///
250250
/// # Examples
251251
///

0 commit comments

Comments
 (0)