diff --git a/src/bigint.rs b/src/bigint.rs index 4b0e4891..891eeb46 100644 --- a/src/bigint.rs +++ b/src/bigint.rs @@ -59,7 +59,6 @@ impl Neg for Sign { } /// A big signed integer type. -#[derive(Debug)] pub struct BigInt { sign: Sign, data: BigUint, @@ -137,6 +136,12 @@ impl Default for BigInt { } } +impl fmt::Debug for BigInt { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + fmt::Display::fmt(self, f) + } +} + impl fmt::Display for BigInt { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.pad_integral(!self.is_negative(), "", &self.data.to_str_radix(10)) diff --git a/src/biguint.rs b/src/biguint.rs index b790c57a..42350714 100644 --- a/src/biguint.rs +++ b/src/biguint.rs @@ -35,7 +35,6 @@ pub(crate) use self::convert::to_str_radix_reversed; pub use self::iter::{U32Digits, U64Digits}; /// A big unsigned integer type. -#[derive(Debug)] pub struct BigUint { data: Vec, } @@ -106,6 +105,12 @@ impl Default for BigUint { } } +impl fmt::Debug for BigUint { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + fmt::Display::fmt(self, f) + } +} + impl fmt::Display for BigUint { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.pad_integral(true, "", &self.to_str_radix(10))