Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 986dbd1

Browse files
committedJun 30, 2024
Print TypeId as hex for debugging
In <rust-lang#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 a6b22e9 commit 986dbd1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎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)
Failed to load comments.