Open
Description
Summary
This code:
#![warn(clippy::pedantic)]
fn foo(i: u32) {
for i in 0 .. i + 1 {
println!("{}", i);
}
}
Gives:
warning: an inclusive range would be more readable
--> src/main.rs:4:14
|
4 | for i in 0 .. i + 1 {
| ^^^^^^^^^^ help: use: `0..=i`
|
note: the lint level is defined here
--> src/main.rs:1:9
|
1 | #![warn(clippy::pedantic)]
| ^^^^^^^^^^^^^^^^
= note: `#[warn(clippy::range_plus_one)]` implied by `#[warn(clippy::pedantic)]`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#range_plus_one
But ..= isn't performant, especially in inner loops. So for me this seems a bad warning.
Lint Name
No response
Reproducer
I tried this code:
<code>
I saw this happen:
<output>
I expected to see this happen:
Version
No response
Additional Labels
No response