Merge pull request #3333 from 0nkery/lazy-lock

replace lazy_static macro with std::sync::LazyLock
This commit is contained in:
Mark Thom
2026-05-23 09:51:22 -06:00
committed by GitHub
4 changed files with 4 additions and 11 deletions

View File

@@ -52,7 +52,6 @@ use crate::parser::dashu::{Integer, Rational};
use crate::types::*;
use indexmap::IndexMap;
use lazy_static::lazy_static;
use ordered_float::OrderedFloat;
use rand::rngs::StdRng;
@@ -63,11 +62,9 @@ use std::io::Read;
use std::path::PathBuf;
use std::process::ExitCode;
use std::sync::atomic::AtomicBool;
use std::sync::OnceLock;
use std::sync::{LazyLock, OnceLock};
lazy_static! {
pub static ref INTERRUPT: AtomicBool = AtomicBool::new(false);
}
pub static INTERRUPT: LazyLock<AtomicBool> = LazyLock::new(|| AtomicBool::new(false));
/// An instance of Scryer Prolog.
///

View File

@@ -1,6 +1,5 @@
use base64::Engine;
use dashu::integer::{Sign, UBig};
use lazy_static::lazy_static;
use num_order::NumOrd;
use crate::arena::*;
@@ -60,6 +59,7 @@ use std::process::Child;
use std::process::Stdio;
#[cfg(feature = "http")]
use std::str::FromStr;
use std::sync::LazyLock;
#[cfg(feature = "http")]
use std::sync::{Arc, Condvar, Mutex};
@@ -9512,9 +9512,7 @@ impl Machine {
fn rng() -> &'static dyn SecureRandom {
use std::ops::Deref;
lazy_static! {
static ref RANDOM: SystemRandom = SystemRandom::new();
}
static RANDOM: LazyLock<SystemRandom> = LazyLock::new(SystemRandom::new);
RANDOM.deref()
}