Skip to content

Commit 2b623bf

Browse files
committed
further simplify match
1 parent c5b8834 commit 2b623bf

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

components/compositing/compositor.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,15 +1073,11 @@ impl<Window: WindowMethods> IOCompositor<Window> {
10731073
delta: TypedPoint2D<f32, DevicePixel>,
10741074
cursor: TypedPoint2D<i32, DevicePixel>) {
10751075
let event_phase = match (self.scroll_in_progress, self.in_scroll_transaction) {
1076-
(false, Some(last_scroll)) if last_scroll.elapsed() > Duration::from_millis(80) => {
1077-
self.in_scroll_transaction = Some(Instant::now());
1078-
ScrollEventPhase::Start
1079-
},
1080-
(_, _) => {
1081-
self.in_scroll_transaction = Some(Instant::now());
1082-
ScrollEventPhase::Move(self.scroll_in_progress)
1083-
},
1076+
(false, Some(last_scroll)) if last_scroll.elapsed() > Duration::from_millis(80) =>
1077+
ScrollEventPhase::Start,
1078+
(_, _) => ScrollEventPhase::Move(self.scroll_in_progress),
10841079
};
1080+
self.in_scroll_transaction = Some(Instant::now());
10851081
self.pending_scroll_zoom_events.push(ScrollZoomEvent {
10861082
magnification: 1.0,
10871083
delta: delta,

0 commit comments

Comments
 (0)