refactor(Draft): Replace latest() with latest_ref() and data() with data_mut() in multiple files for improved mutability handling and consistency across the codebase (#3987)

* 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
This commit is contained in:
Tunglies
2025-07-04 22:43:23 +08:00
committed by GitHub
parent 3f95c81243
commit 764ef48fd1
36 changed files with 573 additions and 267 deletions

View File

@@ -99,7 +99,7 @@ async fn clean_async() -> bool {
// 1. 处理TUN模式
let tun_task = async {
if Config::verge().data().enable_tun_mode.unwrap_or(false) {
if Config::verge().data_mut().enable_tun_mode.unwrap_or(false) {
let disable_tun = serde_json::json!({
"tun": {
"enable": false
@@ -240,7 +240,7 @@ pub fn hide() {
use crate::module::lightweight::add_light_weight_timer;
let enable_auto_light_weight_mode = Config::verge()
.data()
.data_mut()
.enable_auto_light_weight_mode
.unwrap_or(false);