Skip to content

Commit

Permalink
Merge pull request #1173 from hannobraun/debug
Browse files Browse the repository at this point in the history
Improve `Debug` implementation of `ObjectId`
  • Loading branch information
hannobraun authored Oct 6, 2022
2 parents 773159d + 1da49d5 commit 4f3e9ba
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion crates/fj-kernel/src/stores/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,16 @@ unsafe impl<T> Sync for Handle<T> {}
/// Represents the ID of an object
///
/// See [`Handle::id`].
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)]
#[derive(Clone, Copy, Eq, PartialEq, Hash, Ord, PartialOrd)]
pub struct ObjectId(u64);

impl fmt::Debug for ObjectId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let id = self.0;
write!(f, "object id {id:#x}")
}
}

/// A wrapper around [`Handle`] to define equality based on identity
///
/// This is a utility type that implements [`Eq`]/[`PartialEq`] and other common
Expand Down

0 comments on commit 4f3e9ba

Please sign in to comment.