mirror of
https://github.com/notohh/rustlings.git
synced 2024-12-17 22:58:08 -05:00
The number of exercises can't be zero, but still
This commit is contained in:
parent
afc320bed4
commit
789492d1a9
1 changed files with 1 additions and 1 deletions
|
@ -301,7 +301,7 @@ impl AppState {
|
||||||
|
|
||||||
// Return the index of the next pending exercise or `None` if all exercises are done.
|
// Return the index of the next pending exercise or `None` if all exercises are done.
|
||||||
fn next_pending_exercise_ind(&self) -> Option<usize> {
|
fn next_pending_exercise_ind(&self) -> Option<usize> {
|
||||||
if self.current_exercise_ind == self.exercises.len() - 1 {
|
if self.current_exercise_ind + 1 == self.exercises.len() {
|
||||||
// The last exercise is done.
|
// The last exercise is done.
|
||||||
// Search for exercises not done from the start.
|
// Search for exercises not done from the start.
|
||||||
return self.exercises[..self.current_exercise_ind]
|
return self.exercises[..self.current_exercise_ind]
|
||||||
|
|
Loading…
Reference in a new issue