Skip to content

Commit

Permalink
Don't recommend ONCE_INIT in std::sync::Once
Browse files Browse the repository at this point in the history
ONCE_INIT is deprecated, and so suggesting it as not only being on par with, but before `Once::new` is a bad idea.
  • Loading branch information
Kampfkarren authored Oct 16, 2019
1 parent f54911c commit 247df6e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/libstd/sync/once.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ use crate::thread::{self, Thread};

/// A synchronization primitive which can be used to run a one-time global
/// initialization. Useful for one-time initialization for FFI or related
/// functionality. This type can only be constructed with the [`ONCE_INIT`]
/// value or the equivalent [`Once::new`] constructor.
/// functionality. This type can only be constructed with the [`Once::new`]
/// constructor.
///
/// [`ONCE_INIT`]: constant.ONCE_INIT.html
/// [`Once::new`]: struct.Once.html#method.new
///
/// # Examples
Expand Down

0 comments on commit 247df6e

Please sign in to comment.