Skip to content

Commit 69446e3

Browse files
committed
Print TypeId as hex for debugging
In <#127134>, 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)
1 parent 6c34855 commit 69446e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/any.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ impl hash::Hash for TypeId {
673673
#[stable(feature = "rust1", since = "1.0.0")]
674674
impl fmt::Debug for TypeId {
675675
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
676-
f.debug_tuple("TypeId").field(&self.as_u128()).finish()
676+
write!(f, "TypeId({:#034x})", self.as_u128())
677677
}
678678
}
679679

0 commit comments

Comments
 (0)