aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2019-03-20 03:05:00 -0700
committeriximeow <me@iximeow.net>2020-01-12 16:26:39 -0800
commitd76a1cf75b0ae29147054d9f32a694e6a6d13ef0 (patch)
tree0b1cd8cac2a6a9a167b9cececa94a7124a793622
parentf8b14dd92bf97841791e1938394a20aca982689f (diff)
add impls for address as used by x86_64
-rw-r--r--src/lib.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index b0df1ec..f1671b3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -39,6 +39,12 @@ impl AddressDisplay for usize {
}
}
+impl AddressDisplay for u64 {
+ fn stringy(&self) -> String {
+ format!("{:#x}", self)
+ }
+}
+
impl AddressDisplay for u32 {
fn stringy(&self) -> String {
format!("{:#x}", self)
@@ -59,6 +65,10 @@ impl Address for u32 {
fn to_linear(&self) -> usize { *self as usize }
}
+impl Address for u64 {
+ fn to_linear(&self) -> usize { *self as usize }
+}
+
impl Address for usize {
fn to_linear(&self) -> usize { *self }
}