mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-07-12 16:01:56 +08:00
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:
@@ -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 格式错误")?
|
||||
|
||||
Reference in New Issue
Block a user