From 116263a55b971a234b8ef709a996cd7e409ee596 Mon Sep 17 00:00:00 2001 From: Kenneth Loeffler Date: Sun, 17 Sep 2023 00:57:46 -0700 Subject: [PATCH] Use PollWatcher in memofs StdBackend --- crates/memofs/src/std_backend.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/memofs/src/std_backend.rs b/crates/memofs/src/std_backend.rs index c13ade0b0..f344997fd 100644 --- a/crates/memofs/src/std_backend.rs +++ b/crates/memofs/src/std_backend.rs @@ -5,20 +5,20 @@ use std::thread; use std::time::Duration; use crossbeam_channel::Receiver; -use notify::{watcher, DebouncedEvent, RecommendedWatcher, RecursiveMode, Watcher}; +use notify::{DebouncedEvent, PollWatcher, RecursiveMode, Watcher}; use crate::{DirEntry, Metadata, ReadDir, VfsBackend, VfsEvent}; /// `VfsBackend` that uses `std::fs` and the `notify` crate. pub struct StdBackend { - watcher: RecommendedWatcher, + watcher: PollWatcher, watcher_receiver: Receiver, } impl StdBackend { pub fn new() -> StdBackend { let (notify_tx, notify_rx) = mpsc::channel(); - let watcher = watcher(notify_tx, Duration::from_millis(50)).unwrap(); + let watcher = PollWatcher::new(notify_tx, Duration::from_millis(50)).unwrap(); let (tx, rx) = crossbeam_channel::unbounded();