From e3af36603ac9fced256399adea921bf61c85c165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=B4=E5=A4=A9?= Date: Sat, 11 Apr 2026 04:51:07 +0800 Subject: [PATCH] fix: CI lint errors - openclaw_command import scope, clippy warnings --- src-tauri/src/commands/config.rs | 1 - src-tauri/src/commands/mod.rs | 2 +- src-tauri/src/commands/service.rs | 5 +---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src-tauri/src/commands/config.rs b/src-tauri/src/commands/config.rs index 2c9e4f7..d41eb90 100644 --- a/src-tauri/src/commands/config.rs +++ b/src-tauri/src/commands/config.rs @@ -1,4 +1,3 @@ -#[cfg(not(target_os = "macos"))] use crate::utils::openclaw_command; /// 配置读写命令 use serde::Deserialize; diff --git a/src-tauri/src/commands/mod.rs b/src-tauri/src/commands/mod.rs index a52159a..e1dfb8e 100644 --- a/src-tauri/src/commands/mod.rs +++ b/src-tauri/src/commands/mod.rs @@ -36,7 +36,7 @@ fn default_openclaw_dir() -> PathBuf { fn panel_path_key(path: &std::path::Path) -> String { #[cfg(target_os = "windows")] { - return path.to_string_lossy().replace('/', "\\").to_lowercase(); + path.to_string_lossy().replace('/', "\\").to_lowercase() } #[cfg(not(target_os = "windows"))] { diff --git a/src-tauri/src/commands/service.rs b/src-tauri/src/commands/service.rs index d623d4e..68f8c0a 100644 --- a/src-tauri/src/commands/service.rs +++ b/src-tauri/src/commands/service.rs @@ -2122,8 +2122,5 @@ pub async fn claim_gateway() -> Result<(), String> { pub async fn probe_gateway_port() -> bool { let port = crate::commands::gateway_listen_port(); let addr = format!("127.0.0.1:{port}"); - match tokio::net::TcpStream::connect(&addr).await { - Ok(_) => true, - Err(_) => false, - } + tokio::net::TcpStream::connect(&addr).await.is_ok() }