Skip to content

Commit

Permalink
fix(LazyCell): documentation of get[_mut] was wrong
Browse files Browse the repository at this point in the history
- `LazyCell::get`: said it was returning a **mutable** reference.
- `LazyCell::get_mut`: said it was returning a reference (the mutable
  was missing).
  • Loading branch information
jalil-salame committed Dec 18, 2024
1 parent 37e7459 commit 20bff63
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 20bff63

Please sign in to comment.