From 27d5c7a2106f163f1c0df462db4ca6247f891af2 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 17 Dec 2021 22:38:46 +0000 Subject: [PATCH] Swap around generic argument ordering in DefaultRouter for bindings The bindings generation really should support default generic types in where clauses, but currently does not. To avoid needing to add support during the current release process, we simply swap around the arguments to move them to the first <> instead of the where. --- lightning-invoice/src/utils.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lightning-invoice/src/utils.rs b/lightning-invoice/src/utils.rs index 5918753ae..53fdc13f2 100644 --- a/lightning-invoice/src/utils.rs +++ b/lightning-invoice/src/utils.rs @@ -97,20 +97,20 @@ where } /// A [`Router`] implemented using [`find_route`]. -pub struct DefaultRouter where G: Deref, L::Target: Logger { +pub struct DefaultRouter, L: Deref> where L::Target: Logger { network_graph: G, logger: L, } -impl DefaultRouter where G: Deref, L::Target: Logger { +impl, L: Deref> DefaultRouter where L::Target: Logger { /// Creates a new router using the given [`NetworkGraph`] and [`Logger`]. pub fn new(network_graph: G, logger: L) -> Self { Self { network_graph, logger } } } -impl Router for DefaultRouter -where G: Deref, L::Target: Logger { +impl, L: Deref, S: Score> Router for DefaultRouter +where L::Target: Logger { fn find_route( &self, payer: &PublicKey, params: &RouteParameters, _payment_hash: &PaymentHash, first_hops: Option<&[&ChannelDetails]>, scorer: &S -- 2.39.5