Skip to content

Commit

Permalink
Address more code style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jurvis committed Aug 18, 2022
1 parent f9bf585 commit 35ac88a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lightning-invoice/src/payment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,9 @@ where
let first_hops = self.payer.first_hops();
let inflight_htlcs = self.create_inflight_map(&payment_hash);
let route = self.router.find_route(
&payer, &params, &payment_hash, Some(&first_hops.iter().collect::<Vec<_>>()),
&AccountForInFlightHtlcs { scorer: &mut self.scorer.lock(), inflight_htlcs }
).map_err(|e| PaymentError::Routing(e))?;
&payer, &params, &payment_hash, Some(&first_hops.iter().collect::<Vec<_>>()),
&AccountForInFlightHtlcs { scorer: &mut self.scorer.lock(), inflight_htlcs })
.map_err(|e| PaymentError::Routing(e))?;


match send_payment(&route) {
Expand Down Expand Up @@ -572,7 +572,7 @@ where
.collect();

self.payment_cache.lock().unwrap().entry(payment_hash)
.or_insert(PaymentInfo::new())
.or_insert_with(|| PaymentInfo::new())
.paths.push(payment_info_route_hops);
}

Expand All @@ -595,7 +595,7 @@ where
) -> Result<(), ()> {
let attempts = self.payment_cache.lock().unwrap().entry(payment_hash)
.and_modify(|info| info.attempts.count += 1 )
.or_insert(PaymentInfo {
.or_insert_with(|| PaymentInfo {
attempts: PaymentAttempts {
count: 1,
first_attempted_at: T::now(),
Expand Down

0 comments on commit 35ac88a

Please sign in to comment.