Skip to content

Commit

Permalink
Refactor statement to determine width of range
Browse files Browse the repository at this point in the history
  • Loading branch information
rspencer01 committed Aug 11, 2024
1 parent de5883a commit 363b547
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,11 @@ fn extract_count_with_applicability(
&& let LitKind::Int(Pu128(upper_bound), _) = lit.node
{
// Here we can explicitly calculate the number of iterations
let count = if upper_bound > lower_bound {
let count = if upper_bound >= lower_bound {
match range.limits {
RangeLimits::HalfOpen => upper_bound - lower_bound,
RangeLimits::Closed => upper_bound - lower_bound + 1,
}
} else if upper_bound == lower_bound && range.limits == RangeLimits::Closed {
1
} else {
0
};
Expand Down

0 comments on commit 363b547

Please sign in to comment.