From: Elias Rohrer Date: Thu, 14 Nov 2024 10:52:44 +0000 (+0100) Subject: `rustfmt`: Prepare `lightning-invoice/src/lib.rs` X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=f121508f3bb66afcb7309705732233a31cda9d59;p=rust-lightning `rustfmt`: Prepare `lightning-invoice/src/lib.rs` --- diff --git a/lightning-invoice/src/lib.rs b/lightning-invoice/src/lib.rs index 6f7ec2253..744548f2c 100644 --- a/lightning-invoice/src/lib.rs +++ b/lightning-invoice/src/lib.rs @@ -629,7 +629,8 @@ impl Self { - let amount = match amount_msat.checked_mul(10) { // Invoices are denominated in "pico BTC" + // Invoices are denominated in "pico BTC" + let amount = match amount_msat.checked_mul(10) { Some(amt) => amt, None => { self.error = Some(CreationError::InvalidAmount); @@ -1504,7 +1505,7 @@ impl Bolt11Invoice { /// Returns a list of all fallback addresses as [`Address`]es pub fn fallback_addresses(&self) -> Vec
{ - self.fallbacks().iter().filter_map(|fallback| { + let filter_fn = |fallback: &&Fallback| { let address = match fallback { Fallback::SegWitProgram { version, program } => { match WitnessProgram::new(*version, &program) { @@ -1521,7 +1522,8 @@ impl Bolt11Invoice { }; Some(address) - }).collect() + }; + self.fallbacks().iter().filter_map(filter_fn).collect() } /// Returns a list of all routes included in the invoice