Skip to content

Commit

Permalink
fixup! Move first OnceLock example to LazyLock
Browse files Browse the repository at this point in the history
  • Loading branch information
workingjubilee committed Jun 2, 2024
1 parent 5ed5bb8 commit 4d8ec9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/std/src/sync/lazy_lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ union Data<T, F> {
/// // n.b. static items do not call [`Drop`] on program termination, so this won't be deallocated.
/// // this is fine, as the OS can deallocate the terminated program faster than we can free memory
/// // but tools like valgrind might report "memory leaks" as it isn't obvious this is intentional.
/// static DEEP_THOUGHT: LazyLock<String, fn() -> String> = LazyLock::new(|| {
/// static DEEP_THOUGHT: LazyLock<String> = LazyLock::new(|| {
/// # mod another_crate {
/// # pub fn great_question() -> String { "42".to_string() }
/// # }
Expand Down

0 comments on commit 4d8ec9f

Please sign in to comment.