Refactor configuration access to use latest_arc() instead of latest_ref()

- Updated multiple instances in the codebase to replace calls to latest_ref() with latest_arc() for improved performance and memory management.
- This change affects various modules including validate, enhance, feat (backup, clash, config, profile, proxy, window), utils (draft, i18n, init, network, resolve, server).
- Ensured that all references to configuration data are now using the new arc-based approach to enhance concurrency and reduce cloning overhead.

refactor: update imports to explicitly include ClashInfo and Config in command files
This commit is contained in:
Tunglies
2025-11-04 06:06:20 +08:00
parent 48a19f99e2
commit 2287ea5f0b
37 changed files with 533 additions and 331 deletions
+4 -4
View File
@@ -47,7 +47,7 @@ pub async fn clean_async() -> bool {
let tun_task = async {
let tun_enabled = Config::verge()
.await
.latest_ref()
.latest_arc()
.enable_tun_mode
.unwrap_or(false);
@@ -100,7 +100,7 @@ pub async fn clean_async() -> bool {
// 检查系统代理是否开启
let sys_proxy_enabled = Config::verge()
.await
.latest_ref()
.latest_arc()
.enable_system_proxy
.unwrap_or(false);
@@ -176,7 +176,7 @@ pub async fn clean_async() -> bool {
{
let sys_proxy_enabled = Config::verge()
.await
.latest_ref()
.latest_arc()
.enable_system_proxy
.unwrap_or(false);
@@ -316,7 +316,7 @@ pub async fn hide() {
let enable_auto_light_weight_mode = Config::verge()
.await
.data_mut()
.latest_arc()
.enable_auto_light_weight_mode
.unwrap_or(false);