Skip to content

Commit e211a07

Browse files
authored
Merge pull request #1165 from spkenv/digest-display
Use better display output for flatbuffer objects
2 parents 41e218b + e31618c commit e211a07

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

crates/spfs/src/graph/object.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,13 @@ where
3737

3838
impl std::fmt::Display for Object {
3939
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
40-
f.debug_tuple("Object")
41-
.field(&self.kind())
42-
.field(&self.digest().unwrap())
43-
.finish()
40+
use std::fmt::Write;
41+
42+
f.write_fmt(format_args!("{:?}", self.kind()))?;
43+
f.write_char('[')?;
44+
f.write_fmt(format_args!("{}", self.digest().unwrap()))?;
45+
f.write_char(']')?;
46+
Ok(())
4447
}
4548
}
4649

0 commit comments

Comments
 (0)