From ba85ca32c4cfc61de46851ab89f9c58a28f33c88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Jambr=C3=A9n?= Date: Thu, 11 Jul 2019 23:54:18 +0200 Subject: [PATCH] Check if changed exercise file exists before calling verify. --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index f78f13c..78ed060 100644 --- a/src/main.rs +++ b/src/main.rs @@ -101,7 +101,7 @@ fn watch(exercises: &[Exercise]) -> notify::Result<()> { match rx.recv() { Ok(event) => match event { DebouncedEvent::Create(b) | DebouncedEvent::Chmod(b) | DebouncedEvent::Write(b) => { - if b.extension() == Some(OsStr::new("rs")) { + if b.extension() == Some(OsStr::new("rs")) && b.exists() { println!("----------**********----------\n"); let filepath = b.as_path().canonicalize().unwrap(); let exercise = exercises