From ff5a80dbd3888240812c644c622a560d161bcc44 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 16 Nov 2022 10:10:54 +1100 Subject: [PATCH] Exclude formatting of function fmt_satoshi_in This function is called in a long but clear manner, skip it when formatting. --- bitcoin/src/amount.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bitcoin/src/amount.rs b/bitcoin/src/amount.rs index 5425da0c..731a660b 100644 --- a/bitcoin/src/amount.rs +++ b/bitcoin/src/amount.rs @@ -600,6 +600,7 @@ impl Amount { /// Format the value of this [Amount] in the given denomination. /// /// Does not include the denomination. + #[rustfmt::skip] pub fn fmt_value_in(self, f: &mut dyn fmt::Write, denom: Denomination) -> fmt::Result { fmt_satoshi_in(self.to_sat(), false, f, denom, false, FormatOptions::default()) } @@ -808,10 +809,13 @@ impl Display { } impl fmt::Display for Display { + #[rustfmt::skip] fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let format_options = FormatOptions::from_formatter(f); match &self.style { - DisplayStyle::FixedDenomination { show_denomination, denomination } => fmt_satoshi_in(self.sats_abs, self.is_negative, f, *denomination, *show_denomination, format_options), + DisplayStyle::FixedDenomination { show_denomination, denomination } => { + fmt_satoshi_in(self.sats_abs, self.is_negative, f, *denomination, *show_denomination, format_options) + }, DisplayStyle::DynamicDenomination if self.sats_abs >= Amount::ONE_BTC.to_sat() => { fmt_satoshi_in(self.sats_abs, self.is_negative, f, Denomination::Bitcoin, true, format_options) }, @@ -971,8 +975,8 @@ impl SignedAmount { /// Format the value of this [SignedAmount] in the given denomination. /// /// Does not include the denomination. + #[rustfmt::skip] pub fn fmt_value_in(self, f: &mut dyn fmt::Write, denom: Denomination) -> fmt::Result { - fmt_satoshi_in(self.to_sat_abs(), self.is_negative(), f, denom, false, FormatOptions::default()) }