diff --git a/cli/file_watcher.rs b/cli/file_watcher.rs index 53e6c50762..7bc4dd7b72 100644 --- a/cli/file_watcher.rs +++ b/cli/file_watcher.rs @@ -55,8 +55,7 @@ impl Stream for Debounce { self: Pin<&mut Self>, cx: &mut Context, ) -> Poll> { - if self.event_detected.load(Ordering::Relaxed) { - self.event_detected.store(false, Ordering::Relaxed); + if self.event_detected.swap(false, Ordering::Relaxed) { Poll::Ready(Some(())) } else { let mut timer = self.project().timer;