refactor: replace singleton_lazy with singleton macro across multiple modules

This commit is contained in:
Tunglies
2025-11-19 22:40:52 +08:00
parent 108a05ce96
commit d8090277af
6 changed files with 23 additions and 79 deletions
+6 -3
View File
@@ -3,7 +3,7 @@ use crate::utils::autostart as startup_shortcut;
use crate::{
config::{Config, IVerge},
core::handle::Handle,
singleton_lazy,
singleton,
};
use anyhow::Result;
use clash_verge_logging::{Type, logging, logging_error};
@@ -103,10 +103,13 @@ async fn execute_sysproxy_command(args: Vec<std::string::String>) -> Result<()>
Ok(())
}
// Use simplified singleton_lazy macro
singleton_lazy!(Sysopt, SYSOPT, Sysopt::default);
singleton!(Sysopt, SYSOPT);
impl Sysopt {
fn new() -> Self {
Self::default()
}
pub fn is_initialed(&self) -> bool {
self.initialed.load(Ordering::SeqCst)
}