fix gpt ascii
This commit is contained in:
@@ -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(())
|
||||
|
||||
Reference in New Issue
Block a user