chore(rust): upgrade to 1.100 and consolidate Clippy rules (#8636)

This commit is contained in:
Tunglies
2026-11-13 05:29:47 +00:00
committed by GitHub
parent 3cfef4a990
commit 8ca401a742
40 changed files with 137 additions and 166 deletions
+5 -5
View File
@@ -14,10 +14,10 @@ use anyhow::{Result, anyhow};
use clash_verge_draft::DraftTransaction;
use clash_verge_logging::{Type, logging};
use clash_verge_service_ipc::StageRuntimeOutcome;
use scopeguard::defer;
use smartstring::alias::String;
use std::{
collections::HashSet,
mem::DropGuard,
path::PathBuf,
sync::Arc,
time::{Duration, Instant},
@@ -191,9 +191,9 @@ impl CoreManager {
logging!(debug, Type::Core, "Configuration update is already running");
return Ok(ValidationOutcome::Busy);
}
defer! {
let _config_update = DropGuard::new((), |()| {
self.finish_config_update();
}
});
if !force && !self.should_update_config() {
logging!(debug, Type::Core, "Skipping config update due to debounce");
@@ -314,9 +314,9 @@ impl CoreManager {
logging!(debug, Type::Core, "Configuration update is already running");
return Ok(ValidationOutcome::Busy);
}
defer! {
let _config_update = DropGuard::new((), |()| {
self.finish_config_update();
}
});
let runtime = Config::runtime().await;
let transaction = DraftTransaction::begin(vec![&runtime])?;
+11 -12
View File
@@ -6,9 +6,8 @@ use crate::core::proxy_control::{self, SysproxyFailure};
use crate::core::service::{SERVICE_MANAGER, ServiceStatus};
use anyhow::Result;
use clash_verge_logging::{Type, logging};
use scopeguard::defer;
use smartstring::alias::String;
use std::path::Path;
use std::{mem::DropGuard, path::Path};
#[cfg(target_os = "windows")]
use tauri_plugin_clash_verge_sysinfo::is_current_app_handle_admin;
@@ -356,9 +355,9 @@ impl CoreManager {
if !self.try_start_config_update() {
anyhow::bail!("configuration update is already running");
}
defer! {
let _config_update = DropGuard::new((), |()| {
self.finish_config_update();
}
});
self.start_core_during_config_update().await
}
@@ -383,9 +382,9 @@ impl CoreManager {
service_rejection,
));
}
defer! {
let _config_update = DropGuard::new((), |()| {
self.finish_config_update();
}
});
// Lock order is config then lifecycle. disable_tun_and_persist commits the shared Verge
// draft without claiming it, so without this it can commit another transaction's staged patch.
let config_write = Config::lock_config_write().await;
@@ -463,9 +462,9 @@ impl CoreManager {
if !self.try_start_config_update() {
anyhow::bail!("configuration update is already running");
}
defer! {
let _config_update = DropGuard::new((), |()| {
self.finish_config_update();
}
});
// Lock order is config then lifecycle, for the unclaimed draft write below.
let _config_write = Config::lock_config_write().await;
let _life = self.lifecycle_lock.lock().await;
@@ -795,9 +794,9 @@ impl CoreManager {
if !self.try_start_config_update() {
anyhow::bail!("configuration update is already running");
}
defer! {
let _config_update = DropGuard::new((), |()| {
self.finish_config_update();
}
});
self.restart_core_during_config_update().await
}
@@ -966,9 +965,9 @@ impl CoreManager {
if !self.try_start_config_update() {
return HandoffOutcome::NotReady;
}
defer! {
let _config_update = DropGuard::new((), |()| {
self.finish_config_update();
}
});
// Lock order is config then lifecycle.
let _life = self.lifecycle_lock.lock().await;