From: Matt Corallo Date: Sat, 10 Sep 2022 20:31:52 +0000 (+0000) Subject: Inline generic bounds rather than using the `where` clause X-Git-Tag: v0.0.111~1^2~3 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=95eb2b52be7510940404d779ff17d887edd32bb3;p=rust-lightning Inline generic bounds rather than using the `where` clause The bindings generator is pretty naive in its generic resolution and doesn't like `where` clauses for bounds that are simple traits. This should eventually change, but for now its simplest to just inline the relevant generic bounds. --- diff --git a/lightning/src/util/persist.rs b/lightning/src/util/persist.rs index 522c1c92a..d04c3430b 100644 --- a/lightning/src/util/persist.rs +++ b/lightning/src/util/persist.rs @@ -26,13 +26,12 @@ pub trait KVStorePersister { } /// Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk. -pub trait Persister<'a, Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref, S> +pub trait Persister<'a, Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref, S: WriteableScore<'a>> where M::Target: 'static + chain::Watch, T::Target: 'static + BroadcasterInterface, K::Target: 'static + KeysInterface, F::Target: 'static + FeeEstimator, L::Target: 'static + Logger, - S: WriteableScore<'a>, { /// Persist the given ['ChannelManager'] to disk, returning an error if persistence failed. fn persist_manager(&self, channel_manager: &ChannelManager) -> Result<(), io::Error>; @@ -44,13 +43,12 @@ pub trait Persister<'a, Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: fn persist_scorer(&self, scorer: &S) -> Result<(), io::Error>; } -impl<'a, A: KVStorePersister, Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref, S> Persister<'a, Signer, M, T, K, F, L, S> for A +impl<'a, A: KVStorePersister, Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref, S: WriteableScore<'a>> Persister<'a, Signer, M, T, K, F, L, S> for A where M::Target: 'static + chain::Watch, T::Target: 'static + BroadcasterInterface, K::Target: 'static + KeysInterface, F::Target: 'static + FeeEstimator, L::Target: 'static + Logger, - S: WriteableScore<'a>, { /// Persist the given ['ChannelManager'] to disk with the name "manager", returning an error if persistence failed. fn persist_manager(&self, channel_manager: &ChannelManager) -> Result<(), io::Error> {