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`.
This commit is contained in:
Tobin C. Harding 2024-10-31 12:18:47 +11:00
parent 42e5043b33
commit 2b4a61739a
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 3 additions and 1 deletions

View File

@ -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.