Skip to content

Commit acafb7c

Browse files
committed
Impl Binary, LowerHex, Octal, and UpperHex for VirtAddr
1 parent 1fd6937 commit acafb7c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/addr.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,34 @@ impl fmt::Debug for VirtAddr {
206206
}
207207
}
208208

209+
impl fmt::Binary for VirtAddr {
210+
#[inline]
211+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
212+
self.0.fmt(f)
213+
}
214+
}
215+
216+
impl fmt::LowerHex for VirtAddr {
217+
#[inline]
218+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
219+
self.0.fmt(f)
220+
}
221+
}
222+
223+
impl fmt::Octal for VirtAddr {
224+
#[inline]
225+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
226+
self.0.fmt(f)
227+
}
228+
}
229+
230+
impl fmt::UpperHex for VirtAddr {
231+
#[inline]
232+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
233+
self.0.fmt(f)
234+
}
235+
}
236+
209237
impl Add<u64> for VirtAddr {
210238
type Output = Self;
211239
#[inline]

0 commit comments

Comments
 (0)