Skip to content

Commit d7983cc

Browse files
committed
rand_jitter: Fix deprecated code
We no longer support Rust < 1.24.
1 parent 4b647ea commit d7983cc

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

rand_jitter/src/lib.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ pub use crate::error::TimerError;
8383
use core::{fmt, mem, ptr};
8484
#[cfg(feature = "std")]
8585
use std::sync::atomic::{AtomicUsize, Ordering};
86-
#[cfg(feature = "std")]
87-
#[allow(deprecated)] // Required for compatibility with Rust < 1.24.
88-
use std::sync::atomic::ATOMIC_USIZE_INIT;
8986

9087
const MEMORY_BLOCKS: usize = 64;
9188
const MEMORY_BLOCKSIZE: usize = 32;
@@ -180,8 +177,7 @@ impl Clone for JitterRng {
180177

181178
// Initialise to zero; must be positive
182179
#[cfg(all(feature = "std", not(target_arch = "wasm32")))]
183-
#[allow(deprecated)]
184-
static JITTER_ROUNDS: AtomicUsize = ATOMIC_USIZE_INIT;
180+
static JITTER_ROUNDS: AtomicUsize = AtomicUsize::new(0);
185181

186182
impl JitterRng {
187183
/// Create a new `JitterRng`. Makes use of `std::time` for a timer, or a

0 commit comments

Comments
 (0)