From 4108a2f25b1bad3a7a31a10dc6d4addc501ba9b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=B4=E5=A4=A9?= Date: Thu, 26 Mar 2026 06:02:46 +0800 Subject: [PATCH] =?UTF-8?q?style:=20clippy=20map=5For(false)=20=E2=86=92?= =?UTF-8?q?=20is=5Fsome=5Fand=20=E4=BF=AE=E5=A4=8D=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/src/commands/config.rs | 2 +- src-tauri/src/commands/messaging.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src-tauri/src/commands/config.rs b/src-tauri/src/commands/config.rs index 302dd63..64d7186 100644 --- a/src-tauri/src/commands/config.rs +++ b/src-tauri/src/commands/config.rs @@ -1278,7 +1278,7 @@ async fn get_local_version() -> Option { let raw = String::from_utf8_lossy(&output.stdout).trim().to_string(); // 输出格式: "OpenClaw 2026.3.24 (hash)" → 取第一个数字开头的词(版本号) raw.split_whitespace() - .find(|w| w.chars().next().map_or(false, |c| c.is_ascii_digit())) + .find(|w| w.chars().next().is_some_and(|c| c.is_ascii_digit())) .map(String::from) } diff --git a/src-tauri/src/commands/messaging.rs b/src-tauri/src/commands/messaging.rs index 8c52fdd..d472df0 100644 --- a/src-tauri/src/commands/messaging.rs +++ b/src-tauri/src/commands/messaging.rs @@ -1102,7 +1102,7 @@ pub async fn check_weixin_plugin_status() -> Result { .ok()?; let raw = String::from_utf8_lossy(&out.stdout).trim().to_string(); raw.split_whitespace() - .find(|w| w.chars().next().map_or(false, |c| c.is_ascii_digit())) + .find(|w| w.chars().next().is_some_and(|c| c.is_ascii_digit())) .map(String::from) }) .unwrap_or_default(); @@ -1152,7 +1152,7 @@ pub async fn run_channel_action( if platform == "weixin" && action == "install" { // 微信 CLI 版本号独立于 OpenClaw(1.0.x / 2.0.x),不能用 OpenClaw 版本号 pin // v2.0.1 需要 OpenClaw >= 2026.3.22 的 SDK,旧版用 v1.0.3(最后兼容版) - let weixin_spec = if version.as_deref().map_or(false, |v| !v.is_empty()) { + let weixin_spec = if version.as_deref().is_some_and(|v| !v.is_empty()) { format!( "@tencent-weixin/openclaw-weixin-cli@{}", version.as_deref().unwrap() @@ -1168,7 +1168,7 @@ pub async fn run_channel_action( let raw = String::from_utf8_lossy(&out.stdout).trim().to_string(); // 输出格式: "OpenClaw 2026.3.24 (hash)" → 取第二个词(版本号) raw.split_whitespace() - .find(|w| w.chars().next().map_or(false, |c| c.is_ascii_digit())) + .find(|w| w.chars().next().is_some_and(|c| c.is_ascii_digit())) .map(String::from) }) .unwrap_or_default();