From: Ian Jackson Date: Fri, 20 Nov 2020 23:46:35 +0000 (+0000) Subject: fix zcoord debug - make it hex X-Git-Tag: otter-0.2.0~454 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=df95131a7d87dc8d0b0bbdca267458025d5eb494;p=otter.git fix zcoord debug - make it hex Signed-off-by: Ian Jackson --- diff --git a/zcoord/zcoord.rs b/zcoord/zcoord.rs index 328c6528..6d63243b 100644 --- a/zcoord/zcoord.rs +++ b/zcoord/zcoord.rs @@ -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); 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)]