Move `collapsible_else_if` to `pedantic`
Looks like a good number of people disagree with this lint so it shouldn't be on by default
Fixes https://github.com/rust-lang/rust-clippy/issues/16209
changelog: [collapsible_else_if]: move to pedantic
r? @Jarcho
rustbot has assigned @Jarcho. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r? to explicitly pick a reviewer
Lintcheck changes for 69db81658ef2f4c54e85c3b5510bbcdb92961b5a
| Lint | Added | Removed | Changed |
|---|---|---|---|
clippy::collapsible_else_if |
0 | 0 | 10 |
This comment will be updated if you push new changes
cc @rust-lang/clippy if anyone has something to add. I personally have no objection.
As someone who doesn't like this lint, 👍
But also, to try to be constructive about it, I think there are also ways it could be made warn-by-default again. For example, suppose the situation is just
if cond1 {
... body with no blocks
} else {
if cond2 {
... body with no blocks ...
}
}
then that one I could agree with linting on more aggressively.
More abstractly, I dislike this lint when doing what it suggests loses consistency between the blocks, but if they're both simple there's no consistency to lose and it'd be better to reduce the indentation. (That gives me another possible phrasing, which I haven't thought through but might work: this lint is good when it reduces total indentation, but if the if is already more or just-as indented, then unindenting the else doesn't really make a material difference.)