mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-19 10:22:07 +08:00
refactor(deps): replace once_cell with std OnceLock and LazyLock
This commit is contained in:
@@ -15,10 +15,14 @@ use crate::{
|
||||
use anyhow::{Context as _, Result, anyhow, bail};
|
||||
use clash_verge_draft::DraftTransaction;
|
||||
use clash_verge_logging::{Type, logging};
|
||||
use once_cell::sync::Lazy;
|
||||
use parking_lot::Mutex;
|
||||
use serde_yaml_ng::Value;
|
||||
use std::{collections::HashSet, net::SocketAddr, str::FromStr as _, sync::OnceLock};
|
||||
use std::{
|
||||
collections::HashSet,
|
||||
net::SocketAddr,
|
||||
str::FromStr as _,
|
||||
sync::{LazyLock, OnceLock},
|
||||
};
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
struct MixedPortFallback {
|
||||
@@ -26,7 +30,7 @@ struct MixedPortFallback {
|
||||
current: u16,
|
||||
}
|
||||
|
||||
static PENDING_FALLBACK_NOTICE: Lazy<Mutex<Option<MixedPortFallback>>> = Lazy::new(|| Mutex::new(None));
|
||||
static PENDING_FALLBACK_NOTICE: LazyLock<Mutex<Option<MixedPortFallback>>> = LazyLock::new(|| Mutex::new(None));
|
||||
static STARTUP_CORE_BLOCK_REASON: OnceLock<String> = OnceLock::new();
|
||||
|
||||
impl Config {
|
||||
|
||||
Reference in New Issue
Block a user