Skip to content

Commit

Permalink
Unrolled build for rust-lang#134452
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rust-timer authored Dec 18, 2024
2 parents 057bdb3 + 20bff63 commit ebd1e65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/core/src/cell/lazy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand All @@ -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
///
Expand Down

0 comments on commit ebd1e65

Please sign in to comment.