mirror of
https://github.com/notohh/rustlings.git
synced 2024-12-17 22:58:08 -05:00
Only handle file changes for the current exercise, no jumping back
This commit is contained in:
parent
89c40ba256
commit
4e4b65711a
1 changed files with 1 additions and 5 deletions
|
@ -100,14 +100,10 @@ impl<'a> WatchState<'a> {
|
||||||
exercise_ind: usize,
|
exercise_ind: usize,
|
||||||
stdout: &mut StdoutLock,
|
stdout: &mut StdoutLock,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
// Don't skip exercises on file changes to avoid confusion from missing exercises.
|
if self.app_state.current_exercise_ind() != exercise_ind {
|
||||||
// Skipping exercises must be explicit in the interactive list.
|
|
||||||
// But going back to an earlier exercise on file change is fine.
|
|
||||||
if self.app_state.current_exercise_ind() < exercise_ind {
|
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
self.app_state.set_current_exercise_ind(exercise_ind)?;
|
|
||||||
self.run_current_exercise(stdout)
|
self.run_current_exercise(stdout)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue