Skip to content

Commit eb890a9

Browse files
committed
Bound Persister's WriteableScore by Deref
This makes the trait marginally more flexible, but more importantly matches our normal structure which makes the bindings generator a bit happier.
1 parent f89e963 commit eb890a9

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lightning-background-processor/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ impl BackgroundProcessor {
935935
F::Target: 'static + FeeEstimator,
936936
L::Target: 'static + Logger,
937937
P::Target: 'static + Persist<<CM::Target as AChannelManager>::Signer>,
938-
PS::Target: 'static + Persister<'a, CM, L, SC>,
938+
PS::Target: 'static + Persister<'a, CM, L, S>,
939939
CM::Target: AChannelManager + Send + Sync,
940940
OM::Target: AOnionMessenger + Send + Sync,
941941
PM::Target: APeerManager + Send + Sync,

lightning/src/util/persist.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,11 @@ pub trait KVStore {
157157
/// Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk.
158158
///
159159
/// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
160-
pub trait Persister<'a, CM: Deref, L: Deref, S: WriteableScore<'a>>
160+
pub trait Persister<'a, CM: Deref, L: Deref, S: Deref>
161161
where
162162
CM::Target: 'static + AChannelManager,
163163
L::Target: 'static + Logger,
164+
S::Target: WriteableScore<'a>,
164165
{
165166
/// Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
166167
///
@@ -175,10 +176,11 @@ where
175176
}
176177

177178

178-
impl<'a, A: KVStore + ?Sized, CM: Deref, L: Deref, S: WriteableScore<'a>> Persister<'a, CM, L, S> for A
179+
impl<'a, A: KVStore + ?Sized, CM: Deref, L: Deref, S: Deref> Persister<'a, CM, L, S> for A
179180
where
180181
CM::Target: 'static + AChannelManager,
181182
L::Target: 'static + Logger,
183+
S::Target: WriteableScore<'a>,
182184
{
183185
fn persist_manager(&self, channel_manager: &CM) -> Result<(), io::Error> {
184186
self.write(CHANNEL_MANAGER_PERSISTENCE_PRIMARY_NAMESPACE,

0 commit comments

Comments
 (0)