refactor(deps): replace once_cell with std OnceLock and LazyLock

This commit is contained in:
Tunglies
2026-10-01 14:34:20 +08:00
committed by GitHub
parent f17ccdc227
commit c8a8d2034c
14 changed files with 30 additions and 28 deletions
+2 -2
View File
@@ -4,9 +4,9 @@ use anyhow::Error;
use arc_swap::{ArcSwap, ArcSwapOption};
use backon::{ConstantBuilder, Retryable as _};
use clash_verge_logging::{Type, logging};
use once_cell::sync::OnceCell;
use reqwest_dav::list_cmd::{ListEntity, ListFile, ListMultiStatus};
use smartstring::alias::String;
use std::sync::OnceLock;
use std::{
collections::HashMap,
env::{consts::OS, temp_dir},
@@ -58,7 +58,7 @@ pub struct WebDavClient {
impl WebDavClient {
pub fn global() -> &'static Self {
static WEBDAV_CLIENT: OnceCell<WebDavClient> = OnceCell::new();
static WEBDAV_CLIENT: OnceLock<WebDavClient> = OnceLock::new();
WEBDAV_CLIENT.get_or_init(|| Self {
config: ArcSwapOption::new(None),
clients: ArcSwap::new(Arc::new(HashMap::new())),