From 1ecf09359ba901cb9c07b5c9dc624f1767430f97 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Fri, 18 Nov 2022 13:09:28 +1100 Subject: [PATCH] Add local variable to reduce line length In order to reduce the line length introduce a local variable `align`. Refactor only, no logic changes. --- bitcoin/src/amount.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bitcoin/src/amount.rs b/bitcoin/src/amount.rs index 731a660b..bf04205a 100644 --- a/bitcoin/src/amount.rs +++ b/bitcoin/src/amount.rs @@ -413,7 +413,8 @@ fn fmt_satoshi_in( } let width = options.width.unwrap_or(0); - let (left_pad, pad_right) = match (num_width < width, options.sign_aware_zero_pad, options.align.unwrap_or(fmt::Alignment::Right)) { + let align = options.align.unwrap_or(fmt::Alignment::Right); + let (left_pad, pad_right) = match (num_width < width, options.sign_aware_zero_pad, align) { (false, _, _) => (0, 0), // Alignment is always right (ignored) when zero-padding (true, true, _) | (true, false, fmt::Alignment::Right) => (width - num_width, 0),