From 0d5511b4ebd5418559bd5227e75e0446ff1a41f3 Mon Sep 17 00:00:00 2001 From: laentropia Date: Wed, 29 Apr 2026 19:42:37 -0600 Subject: [PATCH] fix --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 3b00676..fc20b13 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -161,10 +161,10 @@ impl ops::Neg for Fraction { impl fmt::Display for Fraction { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - if self.num > 1 { - return write!(f, "{0}/{1}", self.num, self.den); - } else { + if self.num == 1 { return write!(f, "{0}", self.num); + } else { + return write!(f, "{0}/{1}", self.num, self.den); } } }