Skip to content

Commit

Permalink
Merge pull request #1165 from spkenv/digest-display
Browse files Browse the repository at this point in the history
Use better display output for flatbuffer objects
  • Loading branch information
rydrman authored Jan 13, 2025
2 parents 41e218b + e31618c commit e211a07
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions crates/spfs/src/graph/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ where

impl std::fmt::Display for Object {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_tuple("Object")
.field(&self.kind())
.field(&self.digest().unwrap())
.finish()
use std::fmt::Write;

f.write_fmt(format_args!("{:?}", self.kind()))?;
f.write_char('[')?;
f.write_fmt(format_args!("{}", self.digest().unwrap()))?;
f.write_char(']')?;
Ok(())
}
}

Expand Down

0 comments on commit e211a07

Please sign in to comment.