Skip to content

Commit 93a81ed

Browse files
committed
fix clippy::range_plus_one
1 parent 9cf64cf commit 93a81ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/permutations.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ where
185185
let mut complete_state = CompleteState::Start { n, k };
186186

187187
// Advance the complete-state iterator to the correct point
188-
for _ in 0..(prev_iteration_count + 1) {
188+
for _ in 0..=prev_iteration_count {
189189
complete_state.advance();
190190
}
191191

@@ -247,7 +247,7 @@ impl CompleteState {
247247
return Known(0);
248248
}
249249

250-
let count: Option<usize> = (n - k + 1..n + 1).fold(Some(1), |acc, i| {
250+
let count: Option<usize> = ((n - k + 1)..=n).fold(Some(1), |acc, i| {
251251
acc.and_then(|acc| acc.checked_mul(i))
252252
});
253253

0 commit comments

Comments
 (0)