From 10912742145eb48c7fe75cd53801f754aa0a2304 Mon Sep 17 00:00:00 2001 From: Roman Stingler Date: Mon, 16 Dec 2024 20:55:14 +0100 Subject: [PATCH] remove once_cell::sync::Lazy for std::sync::LazyLock #613 --- src/exec.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/exec.rs b/src/exec.rs index 02ba2c72..dc0cf420 100644 --- a/src/exec.rs +++ b/src/exec.rs @@ -12,12 +12,12 @@ use std::time::Duration; use anyhow::{bail, Context, Result}; use log::debug; -use once_cell::sync::Lazy; use signal_hook::consts::signal::*; use signal_hook::flag as signal_flag; +use std::sync::LazyLock; use tr::tr; -pub static DEFAULT_SIGNALS: Lazy> = Lazy::new(|| { +pub static DEFAULT_SIGNALS: LazyLock> = LazyLock::new(|| { let arc = Arc::new(AtomicBool::new(true)); signal_flag::register_conditional_default(SIGTERM, Arc::clone(&arc)).unwrap(); signal_flag::register_conditional_default(SIGINT, Arc::clone(&arc)).unwrap(); @@ -25,7 +25,7 @@ pub static DEFAULT_SIGNALS: Lazy> = Lazy::new(|| { arc }); -static CAUGHT_SIGNAL: Lazy> = Lazy::new(|| { +static CAUGHT_SIGNAL: LazyLock> = LazyLock::new(|| { let arc = Arc::new(AtomicUsize::new(0)); signal_flag::register_usize(SIGTERM, Arc::clone(&arc), SIGTERM as usize).unwrap(); signal_flag::register_usize(SIGINT, Arc::clone(&arc), SIGINT as usize).unwrap(); @@ -33,7 +33,7 @@ static CAUGHT_SIGNAL: Lazy> = Lazy::new(|| { arc }); -pub static RAISE_SIGPIPE: Lazy> = Lazy::new(|| { +pub static RAISE_SIGPIPE: LazyLock> = LazyLock::new(|| { let arc = Arc::new(AtomicBool::new(true)); signal_flag::register_conditional_default(SIGPIPE, Arc::clone(&arc)).unwrap(); arc