perf: change patch_config parameter from Mapping to &Mapping for efficiency

This commit is contained in:
Tunglies
2025-11-30 20:44:21 +08:00
parent ae8c302bf4
commit 6897ead070
5 changed files with 19 additions and 20 deletions

View File

@@ -29,7 +29,7 @@ pub async fn get_clash_info() -> CmdResult<ClashInfo> {
/// 修改Clash配置
#[tauri::command]
pub async fn patch_clash_config(payload: Mapping) -> CmdResult {
feat::patch_clash(payload).await.stringify_err()
feat::patch_clash(&payload).await.stringify_err()
}
/// 修改Clash模式
@@ -171,7 +171,7 @@ pub async fn apply_dns_config(apply: bool) -> CmdResult {
// 应用DNS配置到运行时配置
Config::runtime().await.edit_draft(|d| {
d.patch_config(patch);
d.patch_config(&patch);
});
// 重新生成配置