[bindings] Move additional score params from `&()` to `Default`
authorMatt Corallo <git@bluematt.me>
Tue, 23 Jan 2024 06:19:24 +0000 (06:19 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 23 Jan 2024 19:51:04 +0000 (19:51 +0000)
In 26c1639ab69d6780c97a118f09e42cb42304088a (and later in
50c55dcf32466e3ccf17acea50697fc664950deb) we switched to using
`Default::default()` to initialize `()` for scoring parameters in
tests. A number of `()`s slipped back in recently, which we replace
here.

lightning/src/util/test_utils.rs

index 94aec91a5b568a02a5d9de06f5f31bff8fc69006..0621c23733c810d10c15ae93b5c3b82bda20521c 100644 (file)
@@ -151,7 +151,7 @@ impl<'a> Router for TestRouter<'a> {
                                                                                details: first_hops[idx],
                                                                                payer_node_id: &node_id,
                                                                        });
-                                                                       scorer.channel_penalty_msat(&candidate, usage, &());
+                                                                       scorer.channel_penalty_msat(&candidate, usage, &Default::default());
                                                                        continue;
                                                                }
                                                        }
@@ -163,7 +163,7 @@ impl<'a> Router for TestRouter<'a> {
                                                                info: directed,
                                                                short_channel_id: hop.short_channel_id,
                                                        });
-                                                       scorer.channel_penalty_msat(&candidate, usage, &());
+                                                       scorer.channel_penalty_msat(&candidate, usage, &Default::default());
                                                } else {
                                                        let target_node_id = NodeId::from_pubkey(&hop.pubkey);
                                                        let route_hint = RouteHintHop {
@@ -178,7 +178,7 @@ impl<'a> Router for TestRouter<'a> {
                                                                hint: &route_hint,
                                                                target_node_id: &target_node_id,
                                                        });
-                                                       scorer.channel_penalty_msat(&candidate, usage, &());
+                                                       scorer.channel_penalty_msat(&candidate, usage, &Default::default());
                                                }
                                                prev_hop_node = &hop.pubkey;
                                        }