fix(ci): resolve cross-platform clippy warnings

This commit is contained in:
晴天
2026-04-01 16:00:45 +08:00
parent b4350a59c4
commit 476b1a64b0
2 changed files with 8 additions and 4 deletions

View File

@@ -1548,10 +1548,9 @@ pub async fn get_version_info() -> Result<VersionInfo, String> {
}
fn scan_cli_identity(cli_path: &std::path::Path) -> String {
let mut identity_path = cli_path.to_path_buf();
#[cfg(target_os = "windows")]
{
let identity_path = {
let mut identity_path = cli_path.to_path_buf();
let file_name = cli_path
.file_name()
.and_then(|name| name.to_str())
@@ -1566,7 +1565,11 @@ fn scan_cli_identity(cli_path: &std::path::Path) -> String {
identity_path = cmd_path;
}
}
}
identity_path
};
#[cfg(not(target_os = "windows"))]
let identity_path = cli_path.to_path_buf();
identity_path
.canonicalize()

View File

@@ -1593,6 +1593,7 @@ pub fn invalidate_cli_detection_cache() {}
/// 跨平台统一的服务状态检测:纯 TCP 端口连通性macOS/Linux 使用)
#[cfg(not(target_os = "windows"))]
#[allow(dead_code)]
fn check_tcp_service_status(_uid: u32, _label: &str) -> (bool, Option<u32>) {
let port = crate::commands::gateway_listen_port();
let addr = format!("127.0.0.1:{port}");