Skip to content

Commit 789492d

Browse files
committed
The number of exercises can't be zero, but still
1 parent afc320b commit 789492d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/app_state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ impl AppState {
301301

302302
// Return the index of the next pending exercise or `None` if all exercises are done.
303303
fn next_pending_exercise_ind(&self) -> Option<usize> {
304-
if self.current_exercise_ind == self.exercises.len() - 1 {
304+
if self.current_exercise_ind + 1 == self.exercises.len() {
305305
// The last exercise is done.
306306
// Search for exercises not done from the start.
307307
return self.exercises[..self.current_exercise_ind]

0 commit comments

Comments
 (0)