Fix docs for OnceLock::get_mut_or_init

This commit is contained in:
Juniper Tyree 2024-07-31 22:00:38 +03:00 committed by GitHub
parent 99322d84c4
commit 83fb140ec1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -281,9 +281,7 @@ impl<T> OnceLock<T> {
/// Gets the mutable reference of the contents of the cell, initializing
/// it with `f` if the cell was empty.
///
/// Many threads may call `get_mut_or_init` concurrently with different
/// initializing functions, but it is guaranteed that only one function
/// will be executed.
/// This method never blocks.
///
/// # Panics
///
@ -373,6 +371,8 @@ impl<T> OnceLock<T> {
/// it with `f` if the cell was empty. If the cell was empty and `f` failed,
/// an error is returned.
///
/// This method never blocks.
///
/// # Panics
///
/// If `f` panics, the panic is propagated to the caller, and