MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / rewrite_json

Function rewrite_json

tests/mcp_suite/fixture.rs:389–393  ·  view source on GitHub ↗
(path: &Path, edit: impl FnOnce(&mut Value))

Source from the content-addressed store, hash-verified

387}
388
389fn rewrite_json(path: &Path, edit: impl FnOnce(&mut Value)) -> io::Result<()> {
390 let mut value: Value = serde_json::from_str(&fs::read_to_string(path)?)?;
391 edit(&mut value);
392 fs::write(path, serde_json::to_string_pretty(&value)?)
393}
394
395fn io_other(err: impl std::fmt::Display) -> io::Error {
396 io::Error::other(err.to_string())

Callers 1

seed_storeFunction · 0.85

Calls 1

writeFunction · 0.85

Tested by

no test coverage detected