mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 17:15:38 +08:00
fix: clippy lint
This commit is contained in:
@@ -4,7 +4,7 @@ use crate::cmd::CmdResult;
|
||||
#[cfg(windows)]
|
||||
mod platform {
|
||||
use crate::cmd::CmdResult;
|
||||
use crate::cmd::StringifyErr;
|
||||
use crate::cmd::StringifyErr as _;
|
||||
use crate::core::win_uwp;
|
||||
|
||||
pub fn invoke_uwp_tool() -> CmdResult {
|
||||
|
||||
@@ -520,7 +520,7 @@ impl EventDrivenProxyManager {
|
||||
|
||||
use crate::utils::dirs;
|
||||
#[allow(unused_imports)] // creation_flags必须
|
||||
use std::os::windows::process::CommandExt;
|
||||
use std::os::windows::process::CommandExt as _;
|
||||
use tokio::process::Command;
|
||||
|
||||
let binary_path = match dirs::service_path() {
|
||||
|
||||
@@ -37,7 +37,7 @@ async fn uninstall_service() -> Result<()> {
|
||||
|
||||
use deelevate::{PrivilegeLevel, Token};
|
||||
use runas::Command as RunasCommand;
|
||||
use std::os::windows::process::CommandExt;
|
||||
use std::os::windows::process::CommandExt as _;
|
||||
|
||||
let binary_path = dirs::service_path()?;
|
||||
let uninstall_path = binary_path.with_file_name("clash-verge-service-uninstall.exe");
|
||||
@@ -72,7 +72,7 @@ async fn install_service() -> Result<()> {
|
||||
|
||||
use deelevate::{PrivilegeLevel, Token};
|
||||
use runas::Command as RunasCommand;
|
||||
use std::os::windows::process::CommandExt;
|
||||
use std::os::windows::process::CommandExt as _;
|
||||
|
||||
let binary_path = dirs::service_path()?;
|
||||
let install_path = binary_path.with_file_name("clash-verge-service-install.exe");
|
||||
|
||||
@@ -59,7 +59,7 @@ async fn execute_sysproxy_command(args: Vec<std::string::String>) -> Result<()>
|
||||
use crate::utils::dirs;
|
||||
use anyhow::bail;
|
||||
#[allow(unused_imports)] // Required for .creation_flags() method
|
||||
use std::os::windows::process::CommandExt;
|
||||
use std::os::windows::process::CommandExt as _;
|
||||
use tokio::process::Command;
|
||||
|
||||
let binary_path = dirs::service_path()?;
|
||||
|
||||
@@ -11,19 +11,14 @@ mod module;
|
||||
mod process;
|
||||
pub mod utils;
|
||||
use crate::constants::files;
|
||||
#[cfg(target_os = "macos")]
|
||||
use crate::module::lightweight;
|
||||
#[cfg(target_os = "linux")]
|
||||
use crate::utils::linux;
|
||||
#[cfg(target_os = "macos")]
|
||||
use crate::utils::window_manager::WindowManager;
|
||||
use crate::{
|
||||
core::{EventDrivenProxyManager, handle, hotkey},
|
||||
core::{EventDrivenProxyManager, handle},
|
||||
process::AsyncHandler,
|
||||
utils::{resolve, server},
|
||||
};
|
||||
use anyhow::Result;
|
||||
use config::Config;
|
||||
use once_cell::sync::OnceCell;
|
||||
use rust_i18n::i18n;
|
||||
use tauri::{AppHandle, Manager as _};
|
||||
@@ -269,8 +264,18 @@ pub fn run() {
|
||||
.invoke_handler(app_init::generate_handlers());
|
||||
|
||||
mod event_handlers {
|
||||
use super::*;
|
||||
use crate::core::handle;
|
||||
#[cfg(target_os = "macos")]
|
||||
use crate::module::lightweight;
|
||||
#[cfg(target_os = "macos")]
|
||||
use crate::utils::window_manager::WindowManager;
|
||||
use crate::{
|
||||
config::Config,
|
||||
core::{self, handle, hotkey},
|
||||
logging,
|
||||
process::AsyncHandler,
|
||||
utils::logging::Type,
|
||||
};
|
||||
use tauri::AppHandle;
|
||||
|
||||
pub fn handle_ready_resumed(_app_handle: &AppHandle) {
|
||||
if handle::Handle::global().is_exiting() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use tauri::Manager;
|
||||
use tauri::Manager as _;
|
||||
use windows_sys::Win32::{
|
||||
Foundation::{HWND, LPARAM, LRESULT, WPARAM},
|
||||
UI::WindowsAndMessaging::{
|
||||
|
||||
@@ -4,7 +4,7 @@ use crate::{logging, utils::logging::Type};
|
||||
use anyhow::{Result, anyhow};
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
use std::{os::windows::process::CommandExt, path::Path, path::PathBuf};
|
||||
use std::{os::windows::process::CommandExt as _, path::Path, path::PathBuf};
|
||||
|
||||
/// Windows 下的开机启动文件夹路径
|
||||
#[cfg(target_os = "windows")]
|
||||
@@ -37,7 +37,7 @@ pub fn get_exe_path() -> Result<PathBuf> {
|
||||
/// 创建快捷方式
|
||||
#[cfg(target_os = "windows")]
|
||||
pub async fn create_shortcut() -> Result<()> {
|
||||
use crate::utils::dirs::PathBufExec;
|
||||
use crate::utils::dirs::PathBufExec as _;
|
||||
|
||||
let exe_path = get_exe_path()?;
|
||||
let startup_dir = get_startup_dir()?;
|
||||
@@ -90,7 +90,7 @@ pub async fn create_shortcut() -> Result<()> {
|
||||
/// 删除快捷方式
|
||||
#[cfg(target_os = "windows")]
|
||||
pub async fn remove_shortcut() -> Result<()> {
|
||||
use crate::utils::dirs::PathBufExec;
|
||||
use crate::utils::dirs::PathBufExec as _;
|
||||
|
||||
let startup_dir = get_startup_dir()?;
|
||||
let old_shortcut_path = startup_dir.join("Clash-Verge.lnk");
|
||||
|
||||
@@ -466,7 +466,7 @@ pub async fn init_resources() -> Result<()> {
|
||||
#[cfg(target_os = "windows")]
|
||||
pub fn init_scheme() -> Result<()> {
|
||||
use tauri::utils::platform::current_exe;
|
||||
use winreg::{RegKey, enums::*};
|
||||
use winreg::{RegKey, enums::HKEY_CURRENT_USER};
|
||||
|
||||
let app_exe = current_exe()?;
|
||||
let app_exe = dunce::canonicalize(app_exe)?;
|
||||
|
||||
Reference in New Issue
Block a user