Skip to content

Commit f121508

Browse files
committed
rustfmt: Prepare lightning-invoice/src/lib.rs
1 parent bb51801 commit f121508

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lightning-invoice/src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,8 @@ impl<D: tb::Bool, H: tb::Bool, T: tb::Bool, C: tb::Bool, S: tb::Bool, M: tb::Boo
629629

630630
/// Sets the amount in millisatoshis. The optimal SI prefix is chosen automatically.
631631
pub fn amount_milli_satoshis(mut self, amount_msat: u64) -> Self {
632-
let amount = match amount_msat.checked_mul(10) { // Invoices are denominated in "pico BTC"
632+
// Invoices are denominated in "pico BTC"
633+
let amount = match amount_msat.checked_mul(10) {
633634
Some(amt) => amt,
634635
None => {
635636
self.error = Some(CreationError::InvalidAmount);
@@ -1504,7 +1505,7 @@ impl Bolt11Invoice {
15041505

15051506
/// Returns a list of all fallback addresses as [`Address`]es
15061507
pub fn fallback_addresses(&self) -> Vec<Address> {
1507-
self.fallbacks().iter().filter_map(|fallback| {
1508+
let filter_fn = |fallback: &&Fallback| {
15081509
let address = match fallback {
15091510
Fallback::SegWitProgram { version, program } => {
15101511
match WitnessProgram::new(*version, &program) {
@@ -1521,7 +1522,8 @@ impl Bolt11Invoice {
15211522
};
15221523

15231524
Some(address)
1524-
}).collect()
1525+
};
1526+
self.fallbacks().iter().filter_map(filter_fn).collect()
15251527
}
15261528

15271529
/// Returns a list of all routes included in the invoice

0 commit comments

Comments
 (0)