Skip to content

Commit

Permalink
fix clippy::range_plus_one
Browse files Browse the repository at this point in the history
  • Loading branch information
hellow554 committed Jul 7, 2022
1 parent a56fb76 commit c5f60ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/permutations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ where
let mut complete_state = CompleteState::Start { n, k };

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

Expand Down Expand Up @@ -250,7 +250,7 @@ impl CompleteState {
return Known(0);
}

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

Expand Down

0 comments on commit c5f60ea

Please sign in to comment.