Skip to content

Commit 907d92b

Browse files
committed
Use debug builder
1 parent acafb7c commit 907d92b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/addr.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ impl VirtAddr {
202202

203203
impl fmt::Debug for VirtAddr {
204204
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
205-
write!(f, "VirtAddr({:#x})", self.0)
205+
f.debug_tuple("VirtAddr")
206+
.field(&format_args!("{:#x}", self.0))
207+
.finish()
206208
}
207209
}
208210

@@ -407,7 +409,9 @@ impl PhysAddr {
407409

408410
impl fmt::Debug for PhysAddr {
409411
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
410-
write!(f, "PhysAddr({:#x})", self.0)
412+
f.debug_tuple("PhysAddr")
413+
.field(&format_args!("{:#x}", self.0))
414+
.finish()
411415
}
412416
}
413417

0 commit comments

Comments
 (0)