From: Matt Corallo Date: Sat, 18 Dec 2021 19:52:11 +0000 (+0000) Subject: Swap around generic argument ordering in InvoicePayer for bindings X-Git-Tag: v0.0.105~47^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=7d1e1873f34b1de87ec9cfbe13c9111f892b5c8d;p=rust-lightning Swap around generic argument ordering in InvoicePayer for bindings The bindings generation really should support generic bounds other than Deref::Target 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. --- diff --git a/lightning-invoice/src/payment.rs b/lightning-invoice/src/payment.rs index d08f38fac..4e249a85c 100644 --- a/lightning-invoice/src/payment.rs +++ b/lightning-invoice/src/payment.rs @@ -150,13 +150,12 @@ use std::time::{Duration, SystemTime}; /// See [module-level documentation] for details. /// /// [module-level documentation]: crate::payment -pub struct InvoicePayer +pub struct InvoicePayer where P::Target: Payer, R: for <'a> Router<<::Target as LockableScore<'a>>::Locked>, S::Target: for <'a> LockableScore<'a>, L::Target: Logger, - E: EventHandler, { payer: P, router: R, @@ -221,13 +220,12 @@ pub enum PaymentError { Sending(PaymentSendFailure), } -impl InvoicePayer +impl InvoicePayer where P::Target: Payer, R: for <'a> Router<<::Target as LockableScore<'a>>::Locked>, S::Target: for <'a> LockableScore<'a>, L::Target: Logger, - E: EventHandler, { /// Creates an invoice payer that retries failed payment paths. /// @@ -455,13 +453,12 @@ fn has_expired(params: &RouteParameters) -> bool { } else { false } } -impl EventHandler for InvoicePayer +impl EventHandler for InvoicePayer where P::Target: Payer, R: for <'a> Router<<::Target as LockableScore<'a>>::Locked>, S::Target: for <'a> LockableScore<'a>, L::Target: Logger, - E: EventHandler, { fn handle_event(&self, event: &Event) { match event {