Rollup merge of #127179 - tgross35:typeid-debug-hex, r=Nilstrieb
Print `TypeId` as hex for debugging In <https://github.com/rust-lang/rust/pull/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)
This commit is contained in:
commit
35a1ca043e
@ -673,7 +673,7 @@ fn hash<H: hash::Hasher>(&self, state: &mut H) {
|
|||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
impl fmt::Debug for TypeId {
|
impl fmt::Debug for TypeId {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
|
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())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user