Skip to content

Commit

Permalink
Remove use of deprecated ATOMIC_USIZE_INIT
Browse files Browse the repository at this point in the history
  • Loading branch information
dhardy committed Jan 8, 2020
1 parent ae3a416 commit ae4683c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/rngs/adapter/reseeding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,6 @@ where
#[cfg(all(unix, feature = "std", not(target_os = "emscripten")))]
mod fork {
use core::sync::atomic::{AtomicUsize, Ordering};
#[allow(deprecated)] // Required for compatibility with Rust < 1.24.
use core::sync::atomic::{ATOMIC_USIZE_INIT};
use std::sync::Once;

// Fork protection
Expand All @@ -298,8 +296,7 @@ mod fork {
// don't update `fork_counter`, so a reseed is attempted as soon as
// possible.

#[allow(deprecated)]
static RESEEDING_RNG_FORK_COUNTER: AtomicUsize = ATOMIC_USIZE_INIT;
static RESEEDING_RNG_FORK_COUNTER: AtomicUsize = AtomicUsize::new(0);

pub fn get_fork_counter() -> usize {
RESEEDING_RNG_FORK_COUNTER.load(Ordering::Relaxed)
Expand Down

0 comments on commit ae4683c

Please sign in to comment.