mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-04-15 22:40:42 +08:00
- 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
21 lines
473 B
Rust
21 lines
473 B
Rust
use super::CmdResult;
|
|
use crate::{
|
|
cmd::StringifyErr,
|
|
config::{Config, IVerge},
|
|
feat,
|
|
utils::draft::SharedBox,
|
|
};
|
|
|
|
/// 获取Verge配置
|
|
#[tauri::command]
|
|
pub async fn get_verge_config() -> CmdResult<SharedBox<IVerge>> {
|
|
let verge = Config::verge().await;
|
|
Ok(verge.latest_arc())
|
|
}
|
|
|
|
/// 修改Verge配置
|
|
#[tauri::command]
|
|
pub async fn patch_verge_config(payload: IVerge) -> CmdResult {
|
|
feat::patch_verge(&payload, false).await.stringify_err()
|
|
}
|