Skip to content

Commit 1beba6a

Browse files
fixed windows file watcher
1 parent 7f41937 commit 1beba6a

File tree

1 file changed

+2
-7
lines changed
  • crates/bin/mimium-cli/src

1 file changed

+2
-7
lines changed

crates/bin/mimium-cli/src/lib.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,6 @@ impl FileRunner {
540540
}
541541
//this api never returns
542542
pub fn cli_loop(&self) {
543-
use notify::event::{EventKind, ModifyKind};
544543
//watcher instance lives only this context
545544
let file_watcher = match self.try_new_watcher() {
546545
Ok(watcher) => watcher,
@@ -552,17 +551,13 @@ impl FileRunner {
552551

553552
loop {
554553
match file_watcher.rx.recv() {
555-
Ok(Ok(Event {
556-
kind: EventKind::Modify(ModifyKind::Data(_)),
557-
..
558-
})) => {
559-
log::info!("File changed, recompiling...");
554+
Ok(Ok(event)) => {
555+
log::info!("File event detected ({:?}), recompiling...", event.kind);
560556
self.recompile_file();
561557
}
562558
Ok(Err(e)) => {
563559
log::error!("watch error event: {e}");
564560
}
565-
Ok(_) => {}
566561
Err(e) => {
567562
log::error!("receiver error: {e}");
568563
}

0 commit comments

Comments
 (0)