aboutsummaryrefslogtreecommitdiff
path: root/src/watcher.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/watcher.rs')
-rw-r--r--src/watcher.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/watcher.rs b/src/watcher.rs
index 78d74f2..8918dda 100644
--- a/src/watcher.rs
+++ b/src/watcher.rs
@@ -20,7 +20,7 @@ use crate::{
pub struct DirworldWatcherSet;
/// Event fired when a file watcher event is caught.
-#[derive(Event, Debug)]
+#[derive(Event, Clone, Debug)]
pub struct DirworldWatcherEvent(pub notify::Event);
#[derive(Resource)]
@@ -65,10 +65,9 @@ async fn file_watcher(rx: Receiver<PathBuf>, tx: Sender<notify::Event>) {
loop {
while let Ok(message) = rx.try_recv() {
if let Some(old_path) = &old_path {
- debouncer.watcher().unwatch(old_path).unwrap();
+ debouncer.unwatch(old_path).unwrap();
}
debouncer
- .watcher()
.watch(&message, RecursiveMode::NonRecursive)
.unwrap();
old_path = Some(message);