将序列化中[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

@@ -44,7 +44,7 @@ impl Commit {
pub fn save(&mut self) -> String {
// unimplemented!()
let s = store::Store::new();
let commit_data = serde_json::to_string(&self).unwrap();
let commit_data = serde_json::to_string_pretty(&self).unwrap();
let hash = s.save(&commit_data);
self.hash = hash.clone();
hash