Better Debug for SignedInteger

This commit is contained in:
Tony Garnock-Jones 2021-07-13 15:59:27 +02:00
parent 6ffc34065f
commit 423c9d0bba
1 changed files with 7 additions and 1 deletions

View File

@ -16,9 +16,15 @@ pub enum SignedIntegerRepr {
Big(Box<BigInt>),
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
#[derive(Clone, PartialEq, Eq, Hash)]
pub struct SignedInteger(SignedIntegerRepr);
impl fmt::Debug for SignedInteger {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
write!(f, "{}n", self)
}
}
impl fmt::Display for SignedInteger {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
match self.repr() {