@@ -497,9 +497,9 @@ where
497
497
let first_hops = self . payer . first_hops ( ) ;
498
498
let inflight_htlcs = self . create_inflight_map ( & payment_hash) ;
499
499
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) ) ?;
503
503
504
504
505
505
match send_payment ( & route) {
@@ -572,7 +572,7 @@ where
572
572
. collect ( ) ;
573
573
574
574
self . payment_cache . lock ( ) . unwrap ( ) . entry ( payment_hash)
575
- . or_insert ( PaymentInfo :: new ( ) )
575
+ . or_insert_with ( || PaymentInfo :: new ( ) )
576
576
. paths . push ( payment_info_route_hops) ;
577
577
}
578
578
@@ -595,7 +595,7 @@ where
595
595
) -> Result < ( ) , ( ) > {
596
596
let attempts = self . payment_cache . lock ( ) . unwrap ( ) . entry ( payment_hash)
597
597
. and_modify ( |info| info. attempts . count += 1 )
598
- . or_insert ( PaymentInfo {
598
+ . or_insert_with ( || PaymentInfo {
599
599
attempts : PaymentAttempts {
600
600
count : 1 ,
601
601
first_attempted_at : T :: now ( ) ,
0 commit comments