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:
commit
fbb9e69226
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
///
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue