Skip to content

Commit 49cf741

Browse files
committed
Use LAzyLock instead of lazy_static.
1 parent 84f3e42 commit 49cf741

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

testable-simd-models/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ readme = "README.md"
1111
[dependencies]
1212
rand = "0.9"
1313
pastey = "0.1.0"
14-
lazy_static = "1.5.0"
1514

1615
[lints.rust]
1716
unexpected_cfgs = { level = "warn" }

testable-simd-models/src/helpers.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22
pub mod test {
33
use crate::abstractions::{bit::Bit, bitvec::BitVec, funarr::FunArray};
44
use rand::prelude::*;
5-
use std::sync::Mutex;
5+
use std::sync::{LazyLock, Mutex};
66

7-
lazy_static::lazy_static! {
8-
static ref RNG : Mutex<StdRng> = {
9-
let seed = rand::rng().random();
10-
println!("\nRandomness seed set to: {:?}", seed);
11-
Mutex::new(StdRng::from_seed(seed))
12-
};
13-
}
7+
static RNG: LazyLock<Mutex<StdRng>> = LazyLock::new(|| {
8+
let seed = rand::rng().random();
9+
println!("\nRandomness seed set to: {:?}", seed);
10+
Mutex::new(StdRng::from_seed(seed))
11+
});
1412

1513
/// Helper trait to generate random values
1614
pub trait HasRandom {

0 commit comments

Comments
 (0)