From 8b2dfdffc1a795101477c7e082b4a234ca324a79 Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Sat, 5 Jun 2021 17:22:23 +0100 Subject: [PATCH] Add proper implementation of debug for Num --- agb/src/number.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/agb/src/number.rs b/agb/src/number.rs index c27401f9..c09b60f7 100644 --- a/agb/src/number.rs +++ b/agb/src/number.rs @@ -1,9 +1,9 @@ use core::{ - fmt::Display, + fmt::{Debug, Display}, ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Rem, RemAssign, Sub, SubAssign}, }; -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug)] +#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub struct Num(i32); pub fn change_base(num: Num) -> Num { @@ -223,3 +223,9 @@ impl Display for Num { Ok(()) } } + +impl Debug for Num { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{}", self) + } +}