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:
@ -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);
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
|
Reference in New Issue
Block a user