]> Repositorios git - scryer-prolog.git/commitdiff
replace lazy_static macro with std::sync::LazyLock
authorDmitry Shlagoff <[email protected]>
Tue, 12 May 2026 13:39:35 +0000 (15:39 +0200)
committerDmitry Shlagoff <[email protected]>
Tue, 12 May 2026 13:40:38 +0000 (15:40 +0200)
.gitignore
Cargo.lock
Cargo.toml
src/machine/mod.rs
src/machine/system_calls.rs

index c2e60e69b1d7da15f346429e4a732c2ebaaaff4f..0679a08c15c64cba4dea0912f57dde3a2418cbea 100644 (file)
@@ -2,4 +2,4 @@ src/static_atoms.rs
 target/
 .direnv/
 
-
+.idea/
\ No newline at end of file
index d00508e5e1ba80fff3f42afe330fcfff67c8cd31..5da7eda0dbe1f9145f039c0ad9b4766898fcb7f7 100644 (file)
@@ -2720,7 +2720,6 @@ dependencies = [
  "iai-callgrind",
  "indexmap",
  "js-sys",
- "lazy_static",
  "lexical",
  "libc",
  "libffi",
index 39801345b6847e8f34d9171f7a808e4c9e612abd..b5815db1f5921707c110cb796499975c3614a45a 100644 (file)
@@ -62,7 +62,6 @@ futures = "0.3"
 fxhash = "0.2.1"
 git-version = "0.3.9"
 indexmap = "2.3.0"
-lazy_static = "1.5.0"
 lexical = "7.0.4"
 libc = "0.2.155"
 libloading = "0.8"
index a38a1baaa78b2905aaddce15a3859f558b32a44e..487fadcc983728d338289c4413043166b8531d67 100644 (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.
 ///
index b48d3a1bd108257dc5a23f23779ce4900dae71be..aac650a1427ea273c9ee5b9a1b51e2f845544b97 100644 (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()
 }