From b98c3ddb29ebcbf153dfd37e57368a0580e715f8 Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 24 Feb 2026 16:25:22 +0800 Subject: [PATCH] fix: add #[cfg(target_os = "windows")] to WSL helper functions to eliminate dead_code warnings --- src-tauri/src/commands/misc.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src-tauri/src/commands/misc.rs b/src-tauri/src/commands/misc.rs index b1dcc3f9..b4dd12d9 100644 --- a/src-tauri/src/commands/misc.rs +++ b/src-tauri/src/commands/misc.rs @@ -657,6 +657,7 @@ fn scan_cli_version(tool: &str) -> (Option, Option) { (None, Some("not installed or not executable".to_string())) } +#[cfg(target_os = "windows")] fn wsl_distro_for_tool(tool: &str) -> Option { let override_dir = match tool { "claude" => crate::settings::get_claude_override_dir(), @@ -694,12 +695,6 @@ fn wsl_distro_from_path(path: &Path) -> Option { } } -/// 非 Windows 平台不支持 WSL 路径解析 -#[cfg(not(target_os = "windows"))] -fn wsl_distro_from_path(_path: &Path) -> Option { - None -} - /// 打开指定提供商的终端 /// /// 根据提供商配置的环境变量启动一个带有该提供商特定设置的终端