Skip to content

Commit a6a43c2

Browse files
committed
Format PersistenceNotifierGuard methods
1 parent 5f1d792 commit a6a43c2

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2837,9 +2837,9 @@ impl<'a> PersistenceNotifierGuard<'a, fn() -> NotifyOption> {
28372837
Self::optionally_notify(cm, || -> NotifyOption { NotifyOption::DoPersist })
28382838
}
28392839

2840-
#[rustfmt::skip]
2841-
fn optionally_notify<F: FnOnce() -> NotifyOption, C: AChannelManager>(cm: &'a C, persist_check: F)
2842-
-> PersistenceNotifierGuard<'a, impl FnOnce() -> NotifyOption> {
2840+
fn optionally_notify<F: FnOnce() -> NotifyOption, C: AChannelManager>(
2841+
cm: &'a C, persist_check: F,
2842+
) -> PersistenceNotifierGuard<'a, impl FnOnce() -> NotifyOption> {
28432843
let read_guard = cm.get_cm().total_consistency_lock.read().unwrap();
28442844
let force_notify = cm.get_cm().process_background_events();
28452845

@@ -2853,8 +2853,12 @@ impl<'a> PersistenceNotifierGuard<'a, fn() -> NotifyOption> {
28532853
match (notify, force_notify) {
28542854
(NotifyOption::DoPersist, _) => NotifyOption::DoPersist,
28552855
(_, NotifyOption::DoPersist) => NotifyOption::DoPersist,
2856-
(NotifyOption::SkipPersistHandleEvents, _) => NotifyOption::SkipPersistHandleEvents,
2857-
(_, NotifyOption::SkipPersistHandleEvents) => NotifyOption::SkipPersistHandleEvents,
2856+
(NotifyOption::SkipPersistHandleEvents, _) => {
2857+
NotifyOption::SkipPersistHandleEvents
2858+
},
2859+
(_, NotifyOption::SkipPersistHandleEvents) => {
2860+
NotifyOption::SkipPersistHandleEvents
2861+
},
28582862
_ => NotifyOption::SkipPersistNoEvents,
28592863
}
28602864
}),
@@ -2880,15 +2884,13 @@ impl<'a> PersistenceNotifierGuard<'a, fn() -> NotifyOption> {
28802884
}
28812885

28822886
impl<'a, F: FnOnce() -> NotifyOption> Drop for PersistenceNotifierGuard<'a, F> {
2883-
#[rustfmt::skip]
28842887
fn drop(&mut self) {
28852888
match (self.should_persist.take().unwrap())() {
28862889
NotifyOption::DoPersist => {
28872890
self.needs_persist_flag.store(true, Ordering::Release);
28882891
self.event_persist_notifier.notify()
28892892
},
2890-
NotifyOption::SkipPersistHandleEvents =>
2891-
self.event_persist_notifier.notify(),
2893+
NotifyOption::SkipPersistHandleEvents => self.event_persist_notifier.notify(),
28922894
NotifyOption::SkipPersistNoEvents => {},
28932895
}
28942896
}

0 commit comments

Comments
 (0)