diff options
| author | Fredrik Jambrén <fredrik@jambren.com> | 2019-07-11 23:54:18 +0200 |
|---|---|---|
| committer | Fredrik Jambrén <fredrik@jambren.com> | 2019-07-11 23:54:18 +0200 |
| commit | ba85ca32c4cfc61de46851ab89f9c58a28f33c88 (patch) | |
| tree | ede64a5c68b6b09d46af6ad7bbce2df5bb681cf6 /src | |
| parent | 70946b85e536e80e70ed9505cb650ca0a3a1fbb5 (diff) | |
Check if changed exercise file exists before calling verify.
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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 |
