style(clippy): auto-fix code style issues and unnecessary map_or allocations detected by cargo clippy
This commit is contained in:
1 parent
febd48c65d
commit
706e9ad172
9 files changed
+131
-74
No files matched your search
@@ -275,7 +275,7 @@ impl McpTool for ListContextWorkspacesHandler {
|
||||
let data = state.context_workspaces.read_with(|ws| {
|
||||
let filtered: Vec<_> = ws
|
||||
.iter()
|
||||
.filter(|w| req.namespace.as_ref().map_or(true, |ns| &w.namespace == ns))
|
||||
.filter(|w| req.namespace.as_ref().is_none_or(|ns| &w.namespace == ns))
|
||||
.collect();
|
||||
serde_json::to_string(&filtered).map_err(|e| e.to_string())
|
||||
})?;
|
||||
|
||||
Reference in new issue
Block a user