summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-08-29 00:32:58 +0200
committermo8it <mo8it@proton.me>2024-08-29 00:32:58 +0200
commit789492d1a9bb686e593b08dd8c4ca3af26652bee (patch)
tree412ac1f4c34bdf452525d5d330aa70b8dcaca1ad /src
parentafc320bed4ca57d19b66f9d1d33d71806f333e27 (diff)
The number of exercises can't be zero, but still
Diffstat (limited to 'src')
-rw-r--r--src/app_state.rs2
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]