mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-14 14:52:08 +08:00
perf: change patch_config parameter from Mapping to &Mapping for efficiency
This commit is contained in:
@@ -84,7 +84,7 @@ pub async fn change_clash_mode(mode: String) {
|
||||
// 更新订阅
|
||||
Config::clash()
|
||||
.await
|
||||
.edit_draft(|d| d.patch_config(mapping));
|
||||
.edit_draft(|d| d.patch_config(&mapping));
|
||||
|
||||
// 分离数据获取和异步调用
|
||||
let clash_data = Config::clash().await.data_arc();
|
||||
|
||||
@@ -9,10 +9,8 @@ use clash_verge_logging::{Type, logging, logging_error};
|
||||
use serde_yaml_ng::Mapping;
|
||||
|
||||
/// Patch Clash configuration
|
||||
pub async fn patch_clash(patch: Mapping) -> Result<()> {
|
||||
Config::clash()
|
||||
.await
|
||||
.edit_draft(|d| d.patch_config(patch.clone()));
|
||||
pub async fn patch_clash(patch: &Mapping) -> Result<()> {
|
||||
Config::clash().await.edit_draft(|d| d.patch_config(patch));
|
||||
|
||||
let res = {
|
||||
// 激活订阅
|
||||
|
||||
Reference in New Issue
Block a user