add text bloat flag

This commit is contained in:
nora 2023-05-07 11:23:20 +02:00
parent 4ae7bf8ad5
commit a7f34d3025
3 changed files with 60 additions and 0 deletions

View file

@ -18,6 +18,16 @@ pub const fn Addr(value: u64) -> Addr {
Addr { value }
}
impl Addr {
pub fn usize(self) -> usize {
self.value.try_into().unwrap()
}
pub fn u64(self) -> u64 {
self.value
}
}
impl Debug for Addr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "0x{:x}", self.value)