mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-04-13 13:30:31 +08:00
* feat: add benchmarking for draft operations and new draft management structure * Refactor Config Access: Replace `latest()` with `latest_ref()` and `data()` with `data_mut()` in multiple files for improved mutability handling and consistency across the codebase. * refactor: remove DraftNew implementation and related benchmarks for cleaner codebase
17 lines
448 B
Rust
17 lines
448 B
Rust
use super::CmdResult;
|
|
use crate::{config::*, feat, wrap_err};
|
|
|
|
/// 获取Verge配置
|
|
#[tauri::command]
|
|
pub fn get_verge_config() -> CmdResult<IVergeResponse> {
|
|
let verge = Config::verge();
|
|
let verge_data = verge.latest_ref().clone();
|
|
Ok(IVergeResponse::from(*verge_data))
|
|
}
|
|
|
|
/// 修改Verge配置
|
|
#[tauri::command]
|
|
pub async fn patch_verge_config(payload: IVerge) -> CmdResult {
|
|
wrap_err!(feat::patch_verge(payload, false).await)
|
|
}
|