From 69446e301cc271fca77b4d4f119540d6b82f1677 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Sun, 30 Jun 2024 13:33:33 -0400 Subject: [PATCH] Print `TypeId` as hex for debugging In , the `Debug` impl for `TypeId` was changed to print a single integer rather than a tuple. Change this again to print as hex for more concise and consistent formatting, as was suggested. Result: TypeId(0x1378bb1c0a0202683eb65e7c11f2e4d7) --- library/core/src/any.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/any.rs b/library/core/src/any.rs index eab11ae288a..59f3b6841d5 100644 --- a/library/core/src/any.rs +++ b/library/core/src/any.rs @@ -673,7 +673,7 @@ fn hash(&self, state: &mut H) { #[stable(feature = "rust1", since = "1.0.0")] impl fmt::Debug for TypeId { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { - f.debug_tuple("TypeId").field(&self.as_u128()).finish() + write!(f, "TypeId({:#034x})", self.as_u128()) } }