From 2b4a61739ae2e9d46b54bdb665a749f0c8b4234e Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 31 Oct 2024 12:18:47 +1100 Subject: [PATCH] Add type to debug output for Amount Debug output usually includes the type (and we do so for `SignedAmount`). Add the type to the `Debug` output of `Amount`. --- units/src/amount/unsigned.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/units/src/amount/unsigned.rs b/units/src/amount/unsigned.rs index bec99c80d..f2f8153c1 100644 --- a/units/src/amount/unsigned.rs +++ b/units/src/amount/unsigned.rs @@ -285,7 +285,9 @@ impl default::Default for Amount { } impl fmt::Debug for Amount { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{} SAT", self.to_sat()) } + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "Amount({} SAT)", self.to_sat()) + } } // No one should depend on a binding contract for Display for this type.