MCP: add the autosave _meta without IndexMut (#280 follow-up)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
11848da0a1
commit
459c8987fe
@@ -161,8 +161,13 @@ impl McpServer {
|
|||||||
content.push(json!({"type": "text", "text": format!("Warning: {e}. Use save_project with a writable path before disconnecting.")}));
|
content.push(json!({"type": "text", "text": format!("Warning: {e}. Use save_project with a writable path before disconnecting.")}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if self.autosave.is_some() {
|
if self.autosave.is_some()
|
||||||
result["_meta"]["effectcraftAutoSave"] = self.autosave_info();
|
&& let Some(obj) = result.as_object_mut()
|
||||||
|
{
|
||||||
|
let meta = obj.entry("_meta").or_insert_with(|| json!({}));
|
||||||
|
if let Some(meta) = meta.as_object_mut() {
|
||||||
|
meta.insert("effectcraftAutoSave".into(), self.autosave_info());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if self.autosave.is_some()
|
if self.autosave.is_some()
|
||||||
&& name == "get_project"
|
&& name == "get_project"
|
||||||
|
|||||||
Reference in New Issue
Block a user