将序列化中[to_string]改为[to_string_pretty]进行格式化,改善显示效果

This commit is contained in:
mrbeanc
2023-12-20 13:13:12 +08:00
parent 642f8b2cff
commit 2255cdaf09
5 changed files with 12 additions and 12 deletions

View File

@@ -41,7 +41,7 @@ impl Tree {
pub fn save(&self) -> String {
let s = store::Store::new();
let tree_data = serde_json::to_string(&self).unwrap();
let tree_data = serde_json::to_string_pretty(&self).unwrap();
let hash = s.save(&tree_data);
hash
}