fix: 修复所有 Clippy 警告,CI 质量门禁全部通过

- agent.rs: !...is_some() → .is_none() (nonminimal_bool)
- config.rs: 去掉 macOS/Windows 块多余 return (needless_return)
- config.rs: &old_pkg → old_pkg (needless_borrow)
- logs.rs: 第二处 saturating_sub + filter_map → map_while (lines_filter_map_ok)
- memory.rs: 两处 for/if-let → .iter().flatten() (manual_flatten)
- tray.rs: let _ = future → std::mem::drop (let_underscore_future)
This commit is contained in:
晴天
2026-03-04 12:43:48 +08:00
parent c096ba143c
commit d8084f9213
5 changed files with 23 additions and 25 deletions

View File

@@ -114,7 +114,7 @@ pub fn update_agent_identity(
.ok_or(format!("Agent「{id}」不存在"))?;
// 确保 identity 字段存在且为对象
if !agent.get("identity").and_then(|i| i.as_object()).is_some() {
if agent.get("identity").and_then(|i| i.as_object()).is_none() {
agent
.as_object_mut()
.ok_or("Agent 格式错误")?