We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent de5883a commit 363b547Copy full SHA for 363b547
clippy_lints/src/methods/map_with_unused_argument_over_ranges.rs
@@ -29,13 +29,11 @@ fn extract_count_with_applicability(
29
&& let LitKind::Int(Pu128(upper_bound), _) = lit.node
30
{
31
// Here we can explicitly calculate the number of iterations
32
- let count = if upper_bound > lower_bound {
+ let count = if upper_bound >= lower_bound {
33
match range.limits {
34
RangeLimits::HalfOpen => upper_bound - lower_bound,
35
RangeLimits::Closed => upper_bound - lower_bound + 1,
36
}
37
- } else if upper_bound == lower_bound && range.limits == RangeLimits::Closed {
38
- 1
39
} else {
40
0
41
};
0 commit comments