2
0

fix gpt ascii

This commit is contained in:
2026-03-23 04:50:55 +09:00
parent 60c8c753ae
commit 7e7cc9080b

View File

@@ -253,7 +253,12 @@ fn save_record(did: &str, collection: &str, rkey: &str, record: &Record) -> Resu
"cid": record.cid,
"value": record.value,
});
fs::write(&path, serde_json::to_string_pretty(&json)?)?;
let formatter = serde_json::ser::PrettyFormatter::with_indent(b" ");
let mut buf = Vec::new();
let mut ser = serde_json::Serializer::with_formatter(&mut buf, formatter);
use serde::Serialize;
json.serialize(&mut ser)?;
fs::write(&path, String::from_utf8(buf)?)?;
println!("Saved: {}", path.display());
Ok(())