From 1da49d5cbec07f53a6ec599abd84e99573b314f4 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 6 Oct 2022 13:17:36 +0200 Subject: [PATCH] Improve `Debug` implementation of `ObjectId` Bring it in line with what the `Debug` implementation of `Handle` does. --- crates/fj-kernel/src/stores/handle.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/fj-kernel/src/stores/handle.rs b/crates/fj-kernel/src/stores/handle.rs index 5aab0ed23..a86263ff8 100644 --- a/crates/fj-kernel/src/stores/handle.rs +++ b/crates/fj-kernel/src/stores/handle.rs @@ -157,9 +157,16 @@ unsafe impl Sync for Handle {} /// 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