summaryrefslogtreecommitdiff
path: root/runtime/ops/fs_events.rs
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/ops/fs_events.rs')
-rw-r--r--runtime/ops/fs_events.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/runtime/ops/fs_events.rs b/runtime/ops/fs_events.rs
index 987a7f62a..30c6d3aaa 100644
--- a/runtime/ops/fs_events.rs
+++ b/runtime/ops/fs_events.rs
@@ -101,7 +101,7 @@ fn op_fs_events_open(
let (sender, receiver) = mpsc::channel::<Result<FsEvent, AnyError>>(16);
let sender = Mutex::new(sender);
let mut watcher: RecommendedWatcher =
- Watcher::new_immediate(move |res: Result<NotifyEvent, NotifyError>| {
+ Watcher::new(move |res: Result<NotifyEvent, NotifyError>| {
let res2 = res.map(FsEvent::from).map_err(AnyError::from);
let sender = sender.lock();
// Ignore result, if send failed it means that watcher was already closed,
@@ -114,11 +114,9 @@ fn op_fs_events_open(
RecursiveMode::NonRecursive
};
for path in &args.paths {
- state
- .borrow_mut::<Permissions>()
- .read
- .check(&PathBuf::from(path))?;
- watcher.watch(path, recursive_mode)?;
+ let path = PathBuf::from(path);
+ state.borrow_mut::<Permissions>().read.check(&path)?;
+ watcher.watch(&path, recursive_mode)?;
}
let resource = FsEventsResource {
watcher,