mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-11 21:29:18 +00:00
fix(watch): make sure watch doesn't skip not passing exercises if you change a previous one
This commit is contained in:
parent
3309a01b5e
commit
244fc903cd
16
src/main.rs
16
src/main.rs
@ -373,10 +373,20 @@ fn watch(exercises: &[Exercise], verbose: bool) -> notify::Result<WatchStatus> {
|
||||
.into_iter()
|
||||
.chain(
|
||||
exercises
|
||||
.iter()
|
||||
.filter(|e| !e.looks_done() && !filepath.ends_with(&e.path)),
|
||||
.into_iter()
|
||||
.take_while(|e| !filepath.ends_with(&e.path))
|
||||
.filter(|e| !e.looks_done()),
|
||||
)
|
||||
.chain(
|
||||
exercises
|
||||
.into_iter()
|
||||
.skip_while(|e| !filepath.ends_with(&e.path)),
|
||||
);
|
||||
let num_done = exercises.iter().filter(|e| e.looks_done()).count();
|
||||
let num_done = exercises
|
||||
.iter()
|
||||
.take_while(|e| !filepath.ends_with(&e.path))
|
||||
.filter(|e| e.looks_done())
|
||||
.count();
|
||||
clear_screen();
|
||||
match verify(pending_exercises, (num_done, exercises.len()), verbose) {
|
||||
Ok(_) => return Ok(WatchStatus::Finished),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user