@@ -2837,9 +2837,9 @@ impl<'a> PersistenceNotifierGuard<'a, fn() -> NotifyOption> {
2837
2837
Self::optionally_notify(cm, || -> NotifyOption { NotifyOption::DoPersist })
2838
2838
}
2839
2839
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> {
2843
2843
let read_guard = cm.get_cm().total_consistency_lock.read().unwrap();
2844
2844
let force_notify = cm.get_cm().process_background_events();
2845
2845
@@ -2853,8 +2853,12 @@ impl<'a> PersistenceNotifierGuard<'a, fn() -> NotifyOption> {
2853
2853
match (notify, force_notify) {
2854
2854
(NotifyOption::DoPersist, _) => NotifyOption::DoPersist,
2855
2855
(_, 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
+ },
2858
2862
_ => NotifyOption::SkipPersistNoEvents,
2859
2863
}
2860
2864
}),
@@ -2880,15 +2884,13 @@ impl<'a> PersistenceNotifierGuard<'a, fn() -> NotifyOption> {
2880
2884
}
2881
2885
2882
2886
impl<'a, F: FnOnce() -> NotifyOption> Drop for PersistenceNotifierGuard<'a, F> {
2883
- #[rustfmt::skip]
2884
2887
fn drop(&mut self) {
2885
2888
match (self.should_persist.take().unwrap())() {
2886
2889
NotifyOption::DoPersist => {
2887
2890
self.needs_persist_flag.store(true, Ordering::Release);
2888
2891
self.event_persist_notifier.notify()
2889
2892
},
2890
- NotifyOption::SkipPersistHandleEvents =>
2891
- self.event_persist_notifier.notify(),
2893
+ NotifyOption::SkipPersistHandleEvents => self.event_persist_notifier.notify(),
2892
2894
NotifyOption::SkipPersistNoEvents => {},
2893
2895
}
2894
2896
}
0 commit comments