Skip to content

Commit a7cf061

Browse files
committed
f rustfmt
1 parent b4d1534 commit a7cf061

File tree

1 file changed

+26
-13
lines changed

1 file changed

+26
-13
lines changed

lightning/src/util/persist.rs

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,9 @@ fn poll_sync_future<F: Future>(future: F) -> F::Output {
507507
/// If you have many stale updates stored (such as after a crash with pending lazy deletes), and
508508
/// would like to get rid of them, consider using the
509509
/// [`MonitorUpdatingPersister::cleanup_stale_updates`] function.
510-
pub struct MonitorUpdatingPersister<K: Deref, L: Deref, ES: Deref, SP: Deref, BI: Deref, FE: Deref>
511-
(MonitorUpdatingPersisterAsync<KVStoreSyncWrapper<K>, L, ES, SP, BI, FE>)
510+
pub struct MonitorUpdatingPersister<K: Deref, L: Deref, ES: Deref, SP: Deref, BI: Deref, FE: Deref>(
511+
MonitorUpdatingPersisterAsync<KVStoreSyncWrapper<K>, L, ES, SP, BI, FE>,
512+
)
512513
where
513514
K::Target: KVStoreSync,
514515
L::Target: Logger,
@@ -635,20 +636,20 @@ where
635636
fn persist_new_channel(
636637
&self, monitor_name: MonitorName, monitor: &ChannelMonitor<ChannelSigner>,
637638
) -> chain::ChannelMonitorUpdateStatus {
638-
let res = poll_sync_future(self.0.0.persist_new_channel(monitor_name, monitor));
639+
let res = poll_sync_future(self.0 .0.persist_new_channel(monitor_name, monitor));
639640
match res {
640641
Ok(_) => chain::ChannelMonitorUpdateStatus::Completed,
641642
Err(e) => {
642643
log_error!(
643-
self.0.0.logger,
644+
self.0 .0.logger,
644645
"Failed to write ChannelMonitor {}/{}/{} reason: {}",
645646
CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE,
646647
CHANNEL_MONITOR_PERSISTENCE_SECONDARY_NAMESPACE,
647648
monitor_name,
648649
e
649650
);
650651
chain::ChannelMonitorUpdateStatus::UnrecoverableError
651-
}
652+
},
652653
}
653654
}
654655

@@ -665,12 +666,13 @@ where
665666
&self, monitor_name: MonitorName, update: Option<&ChannelMonitorUpdate>,
666667
monitor: &ChannelMonitor<ChannelSigner>,
667668
) -> chain::ChannelMonitorUpdateStatus {
668-
let res = poll_sync_future(self.0.0.update_persisted_channel(monitor_name, update, monitor));
669+
let res =
670+
poll_sync_future(self.0 .0.update_persisted_channel(monitor_name, update, monitor));
669671
match res {
670672
Ok(()) => chain::ChannelMonitorUpdateStatus::Completed,
671673
Err(e) => {
672674
log_error!(
673-
self.0.0.logger,
675+
self.0 .0.logger,
674676
"Failed to write ChannelMonitorUpdate {} id {} reason: {}",
675677
monitor_name,
676678
update.as_ref().map(|upd| upd.update_id).unwrap_or(0),
@@ -682,16 +684,22 @@ where
682684
}
683685

684686
fn archive_persisted_channel(&self, monitor_name: MonitorName) {
685-
poll_sync_future(self.0.0.archive_persisted_channel(monitor_name));
687+
poll_sync_future(self.0 .0.archive_persisted_channel(monitor_name));
686688
}
687689
}
688690

689691
/// A variant of the [`MonitorUpdatingPersister`] which utilizes the async [`KVStore`] and offers
690692
/// async versions of the public accessors.
691693
///
692694
/// Note that async monitor updating is considered beta, and bugs may be triggered by its use.
693-
pub struct MonitorUpdatingPersisterAsync<K: Deref, L: Deref, ES: Deref, SP: Deref, BI: Deref, FE: Deref>
694-
(Arc<MonitorUpdatingPersisterAsyncInner<K, L, ES, SP, BI, FE>>)
695+
pub struct MonitorUpdatingPersisterAsync<
696+
K: Deref,
697+
L: Deref,
698+
ES: Deref,
699+
SP: Deref,
700+
BI: Deref,
701+
FE: Deref,
702+
>(Arc<MonitorUpdatingPersisterAsyncInner<K, L, ES, SP, BI, FE>>)
695703
where
696704
K::Target: KVStore,
697705
L::Target: Logger,
@@ -700,8 +708,14 @@ where
700708
BI::Target: BroadcasterInterface,
701709
FE::Target: FeeEstimator;
702710

703-
struct MonitorUpdatingPersisterAsyncInner<K: Deref, L: Deref, ES: Deref, SP: Deref, BI: Deref, FE: Deref>
704-
where
711+
struct MonitorUpdatingPersisterAsyncInner<
712+
K: Deref,
713+
L: Deref,
714+
ES: Deref,
715+
SP: Deref,
716+
BI: Deref,
717+
FE: Deref,
718+
> where
705719
K::Target: KVStore,
706720
L::Target: Logger,
707721
ES::Target: EntropySource + Sized,
@@ -806,7 +820,6 @@ where
806820
}
807821
}
808822

809-
810823
impl<K: Deref, L: Deref, ES: Deref, SP: Deref, BI: Deref, FE: Deref>
811824
MonitorUpdatingPersisterAsyncInner<K, L, ES, SP, BI, FE>
812825
where

0 commit comments

Comments
 (0)