1
0
mirror of https://github.com/rust-lang/rustlings.git synced 2025-06-17 00:07:35 +02:00

feat: improve watch execution mode

The `watch` command now requires user action to move to the next
exercise.

BREAKING CHANGE: this changes the behavior of `watch`.
This commit is contained in:
Roberto Vidal
2019-11-11 13:38:24 +01:00
parent a47a62172a
commit 2cdd61294f
60 changed files with 309 additions and 12 deletions

View File

@ -110,11 +110,11 @@ fn watch(exercises: &[Exercise]) -> notify::Result<()> {
DebouncedEvent::Create(b) | DebouncedEvent::Chmod(b) | DebouncedEvent::Write(b) => {
if b.extension() == Some(OsStr::new("rs")) && b.exists() {
let filepath = b.as_path().canonicalize().unwrap();
let exercise = exercises
let pending_exercises = exercises
.iter()
.skip_while(|e| !filepath.ends_with(&e.path));
clear_screen();
let _ignored = verify(exercise);
let _ignored = verify(pending_exercises);
}
}
_ => {}