aboutsummaryrefslogtreecommitdiff
path: root/src/watcher.rs
diff options
context:
space:
mode:
authorLibravatar Silas Bartha <silas@exvacuum.dev>2024-11-21 12:17:44 -0500
committerLibravatar Silas Bartha <silas@exvacuum.dev>2024-11-21 12:17:44 -0500
commit26e2eddd1efeb0a5fff8ffabebefdae48c4a65dc (patch)
tree7f0903a6c90fb4e09d2894f55cffd0acbcb51350 /src/watcher.rs
parent99c398cc127dbc83480f98fea8c76f7c19d4dce8 (diff)
Thu Nov 21 12:17:44 PM EST 2024
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);