chiark / gitweb /
fix zcoord debug - make it hex
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 20 Nov 2020 23:46:35 +0000 (23:46 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 20 Nov 2020 23:46:35 +0000 (23:46 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
zcoord/zcoord.rs

index 328c6528156594b6acbbe71e0c451bf7b4cab26b..6d63243b7217a9002abda4cb6c58574888233e26 100644 (file)
@@ -88,7 +88,6 @@ const DIGITS_PER_LIMB : usize = 10;
 type RawLimbVal = u64;
 #[derive(Copy,Clone,Eq,PartialEq,Ord,PartialOrd)]
 #[derive(Neg,Add,BitAnd,Sub,Shr,ShrAssign)]
-#[derive(Debug)]
 pub struct LimbVal (Wrapping<RawLimbVal>);
 
 const DELTA : LimbVal = lv(0x4000_0000);
@@ -141,6 +140,12 @@ impl LimbVal {
   fn primitive(self) -> RawLimbVal { self.0.0 }
 }
 
+impl Debug for LimbVal {
+  fn fmt(&self, f: &mut fmt::Formatter) -> Result<(),fmt::Error> {
+    write!(f, "{:x?}", self)
+  }
+}
+
 //---------- Mutabel ----------
 
 #[derive(Clone,Debug)]