]> git.bitcoin.ninja Git - rust-lightning/commitdiff
f - Remove redundant closure
authorJeffrey Czyz <jkczyz@gmail.com>
Fri, 28 Jan 2022 14:44:17 +0000 (08:44 -0600)
committerJeffrey Czyz <jkczyz@gmail.com>
Wed, 2 Feb 2022 16:33:47 +0000 (10:33 -0600)
lightning/src/routing/scoring.rs

index 100363b689ce5a4e1f87e86e69fa6739082b9aa6..1600ae071d2b8a380a98e1671627cd818865922e 100644 (file)
@@ -695,7 +695,7 @@ impl<G: Deref<Target = NetworkGraph>> Score for ProbabilisticScorer<G> {
                        if hop.short_channel_id == short_channel_id {
                                self.channel_liquidities
                                        .entry(hop.short_channel_id)
-                                       .or_insert_with(|| ChannelLiquidity::new())
+                                       .or_insert_with(ChannelLiquidity::new)
                                        .as_directed_mut(&source, &target, capacity_msat)
                                        .failed_at_channel(amount_msat);
                                break;
@@ -703,7 +703,7 @@ impl<G: Deref<Target = NetworkGraph>> Score for ProbabilisticScorer<G> {
 
                        self.channel_liquidities
                                .entry(hop.short_channel_id)
-                               .or_insert_with(|| ChannelLiquidity::new())
+                               .or_insert_with(ChannelLiquidity::new)
                                .as_directed_mut(&source, &target, capacity_msat)
                                .failed_downstream(amount_msat);
                }
@@ -728,7 +728,7 @@ impl<G: Deref<Target = NetworkGraph>> Score for ProbabilisticScorer<G> {
 
                        self.channel_liquidities
                                .entry(hop.short_channel_id)
-                               .or_insert_with(|| ChannelLiquidity::new())
+                               .or_insert_with(ChannelLiquidity::new)
                                .as_directed_mut(&source, &target, capacity_msat)
                                .successful(amount_msat);
                }