style(clippy): auto-fix code style issues and unnecessary map_or allocations detected by cargo clippy

This commit is contained in:
Riz Ashraf committed 2026-09-27 22:38:08 +01:00
1 parent febd48c65d
commit 706e9ad172
9 files changed
+131 -74

No files matched your search

+2 -3
View File
@@ -274,10 +274,9 @@ impl McpTool for ReadPreferencesHandler {
}
async fn execute(&self, _args: Value, state: Arc<MemoryState>) -> Result<String, String> {
let data = state
state
.prefs
.read_with(|prefs| serde_json::to_string(prefs).map_err(|e| e.to_string()));
data
.read_with(|prefs| serde_json::to_string(prefs).map_err(|e| e.to_string()))
}
}
+1 -1
View File
@@ -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())
})?;