diff options
| author | mo8it <mo8it@proton.me> | 2024-08-29 00:32:58 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-08-29 00:32:58 +0200 |
| commit | 789492d1a9bb686e593b08dd8c4ca3af26652bee (patch) | |
| tree | 412ac1f4c34bdf452525d5d330aa70b8dcaca1ad /src/app_state.rs | |
| parent | afc320bed4ca57d19b66f9d1d33d71806f333e27 (diff) | |
The number of exercises can't be zero, but still
Diffstat (limited to 'src/app_state.rs')
| -rw-r--r-- | src/app_state.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/app_state.rs b/src/app_state.rs index cc77711..2a20568 100644 --- a/src/app_state.rs +++ b/src/app_state.rs @@ -301,7 +301,7 @@ impl AppState { // Return the index of the next pending exercise or `None` if all exercises are done. 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. // Search for exercises not done from the start. return self.exercises[..self.current_exercise_ind] |
