Skip to content

Commit bc420a8

Browse files
committed
Format PersistenceNotifierGuard methods
1 parent 9621044 commit bc420a8

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
@@ -2839,9 +2839,9 @@ impl<'a> PersistenceNotifierGuard<'a, fn() -> NotifyOption> {
28392839
Self::optionally_notify(cm, || -> NotifyOption { NotifyOption::DoPersist })
28402840
}
28412841

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

@@ -2855,8 +2855,12 @@ impl<'a> PersistenceNotifierGuard<'a, fn() -> NotifyOption> {
28552855
match (notify, force_notify) {
28562856
(NotifyOption::DoPersist, _) => NotifyOption::DoPersist,
28572857
(_, NotifyOption::DoPersist) => NotifyOption::DoPersist,
2858-
(NotifyOption::SkipPersistHandleEvents, _) => NotifyOption::SkipPersistHandleEvents,
2859-
(_, NotifyOption::SkipPersistHandleEvents) => NotifyOption::SkipPersistHandleEvents,
2858+
(NotifyOption::SkipPersistHandleEvents, _) => {
2859+
NotifyOption::SkipPersistHandleEvents
2860+
},
2861+
(_, NotifyOption::SkipPersistHandleEvents) => {
2862+
NotifyOption::SkipPersistHandleEvents
2863+
},
28602864
_ => NotifyOption::SkipPersistNoEvents,
28612865
}
28622866
}),
@@ -2882,15 +2886,13 @@ impl<'a> PersistenceNotifierGuard<'a, fn() -> NotifyOption> {
28822886
}
28832887

28842888
impl<'a, F: FnOnce() -> NotifyOption> Drop for PersistenceNotifierGuard<'a, F> {
2885-
#[rustfmt::skip]
28862889
fn drop(&mut self) {
28872890
match (self.should_persist.take().unwrap())() {
28882891
NotifyOption::DoPersist => {
28892892
self.needs_persist_flag.store(true, Ordering::Release);
28902893
self.event_persist_notifier.notify()
28912894
},
2892-
NotifyOption::SkipPersistHandleEvents =>
2893-
self.event_persist_notifier.notify(),
2895+
NotifyOption::SkipPersistHandleEvents => self.event_persist_notifier.notify(),
28942896
NotifyOption::SkipPersistNoEvents => {},
28952897
}
28962898
}

0 commit comments

Comments
 (0)