refactor: update imports to use as _ for unused identifiers across multiple files

This commit is contained in:
Tunglies
2025-11-09 22:15:37 +08:00
parent e6c8f762db
commit 4eeb883464
42 changed files with 74 additions and 58 deletions

View File

@@ -13,7 +13,7 @@ use smartstring::alias::String;
use std::{
collections::HashMap,
env::{consts::OS, temp_dir},
io::Write,
io::Write as _,
path::PathBuf,
sync::Arc,
time::Duration,

View File

@@ -2,7 +2,7 @@ use std::sync::Arc;
use tokio::sync::RwLock;
use tokio::sync::{mpsc, oneshot};
use tokio::time::{Duration, sleep, timeout};
use tokio_stream::{StreamExt, wrappers::UnboundedReceiverStream};
use tokio_stream::{StreamExt as _, wrappers::UnboundedReceiverStream};
use crate::config::{Config, IVerge};
use crate::core::{async_proxy_query::AsyncProxyQuery, handle};

View File

@@ -8,8 +8,8 @@ use std::{
},
thread,
};
use tauri::{AppHandle, Manager, WebviewWindow};
use tauri_plugin_mihomo::{Mihomo, MihomoExt};
use tauri::{AppHandle, Manager as _, WebviewWindow};
use tauri_plugin_mihomo::{Mihomo, MihomoExt as _};
use tokio::sync::RwLockReadGuard;
use super::notification::{ErrorMessage, FrontendEvent, NotificationSystem};

View File

@@ -8,7 +8,7 @@ use anyhow::{Result, bail};
use arc_swap::ArcSwap;
use smartstring::alias::String;
use std::{collections::HashMap, fmt, str::FromStr, sync::Arc};
use tauri_plugin_global_shortcut::{Code, GlobalShortcutExt, ShortcutState};
use tauri_plugin_global_shortcut::{Code, GlobalShortcutExt as _, ShortcutState};
/// Enum representing all available hotkey functions
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]

View File

@@ -1,6 +1,6 @@
use super::CoreManager;
use crate::{
config::*,
config::{Config, ConfigType, IRuntime},
constants::timing,
core::{handle, validate::CoreConfigValidator},
logging,

View File

@@ -16,7 +16,7 @@ use compact_str::CompactString;
use flexi_logger::DeferredNow;
use log::Level;
use scopeguard::defer;
use tauri_plugin_shell::ShellExt;
use tauri_plugin_shell::ShellExt as _;
impl CoreManager {
pub async fn get_clash_logs(&self) -> Result<Vec<CompactString>> {

View File

@@ -14,7 +14,7 @@ use std::{
thread,
time::{Duration, Instant},
};
use tauri::{Emitter, WebviewWindow};
use tauri::{Emitter as _, WebviewWindow};
#[derive(Debug, Clone)]
pub enum FrontendEvent {

View File

@@ -4,7 +4,7 @@ use crate::{
logging, logging_error,
utils::{dirs, init::service_writer_config, logging::Type},
};
use anyhow::{Context, Result, bail};
use anyhow::{Context as _, Result, bail};
use clash_verge_service_ipc::CoreConfig;
use compact_str::CompactString;
use once_cell::sync::Lazy;

View File

@@ -12,7 +12,7 @@ use smartstring::alias::String;
use std::sync::atomic::{AtomicBool, Ordering};
#[cfg(not(target_os = "windows"))]
use sysproxy::{Autoproxy, Sysproxy};
use tauri_plugin_autostart::ManagerExt;
use tauri_plugin_autostart::ManagerExt as _;
pub struct Sysopt {
initialed: AtomicBool,

View File

@@ -2,7 +2,7 @@ use crate::{
config::Config, core::sysopt::Sysopt, feat, logging, logging_error, singleton,
utils::logging::Type,
};
use anyhow::{Context, Result};
use anyhow::{Context as _, Result};
use delay_timer::prelude::{DelayTimer, DelayTimerBuilder, TaskBuilder};
use parking_lot::RwLock;
use smartstring::alias::String;

View File

@@ -2,7 +2,7 @@ use anyhow::Result;
use scopeguard::defer;
use smartstring::alias::String;
use std::sync::atomic::{AtomicBool, Ordering};
use tauri_plugin_shell::ShellExt;
use tauri_plugin_shell::ShellExt as _;
use tokio::fs;
use crate::config::{Config, ConfigType};