Skip to content

Commit

Permalink
Fix docs for OnceLock::get_mut_or_init
Browse files Browse the repository at this point in the history
  • Loading branch information
juntyr authored Jul 31, 2024
1 parent 99322d8 commit 83fb140
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/std/src/sync/once_lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 83fb140

Please sign in to comment.