fix: clippy lint

This commit is contained in:
Slinetrac
2025-11-09 23:23:03 +08:00
parent 221a1e89eb
commit 0dcdd7fed6
8 changed files with 23 additions and 18 deletions
+3 -3
View File
@@ -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");
+1 -1
View File
@@ -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)?;