hex Id printouts

This commit is contained in:
Niko Matsakis 2024-08-11 08:03:26 +03:00
parent 08820ea674
commit 5cb519852b
2 changed files with 3 additions and 3 deletions

View file

@ -44,7 +44,7 @@ impl Id {
impl Debug for Id {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "Id({})", self.as_u32())
write!(f, "Id({:x})", self.as_u32())
}
}

View file

@ -129,8 +129,8 @@ pub(crate) fn fmt_index(
fmt: &mut fmt::Formatter<'_>,
) -> fmt::Result {
if let Some(i) = id {
write!(fmt, "{}({})", debug_name, u32::from(i))
write!(fmt, "{debug_name}({i:?})")
} else {
write!(fmt, "{}()", debug_name)
write!(fmt, "{debug_name}()")
}
}