Skip to content

Commit 35ac88a

Browse files
committed
Address more code style issues
1 parent f9bf585 commit 35ac88a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lightning-invoice/src/payment.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -497,9 +497,9 @@ where
497497
let first_hops = self.payer.first_hops();
498498
let inflight_htlcs = self.create_inflight_map(&payment_hash);
499499
let route = self.router.find_route(
500-
&payer, &params, &payment_hash, Some(&first_hops.iter().collect::<Vec<_>>()),
501-
&AccountForInFlightHtlcs { scorer: &mut self.scorer.lock(), inflight_htlcs }
502-
).map_err(|e| PaymentError::Routing(e))?;
500+
&payer, &params, &payment_hash, Some(&first_hops.iter().collect::<Vec<_>>()),
501+
&AccountForInFlightHtlcs { scorer: &mut self.scorer.lock(), inflight_htlcs })
502+
.map_err(|e| PaymentError::Routing(e))?;
503503

504504

505505
match send_payment(&route) {
@@ -572,7 +572,7 @@ where
572572
.collect();
573573

574574
self.payment_cache.lock().unwrap().entry(payment_hash)
575-
.or_insert(PaymentInfo::new())
575+
.or_insert_with(|| PaymentInfo::new())
576576
.paths.push(payment_info_route_hops);
577577
}
578578

@@ -595,7 +595,7 @@ where
595595
) -> Result<(), ()> {
596596
let attempts = self.payment_cache.lock().unwrap().entry(payment_hash)
597597
.and_modify(|info| info.attempts.count += 1 )
598-
.or_insert(PaymentInfo {
598+
.or_insert_with(|| PaymentInfo {
599599
attempts: PaymentAttempts {
600600
count: 1,
601601
first_attempted_at: T::now(),

0 commit comments

Comments
 (0)