-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
A-lintArea: New lintsArea: New lintsE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.Call for participation: Medium difficulty level problem and requires some initial experience.T-middleType: Probably requires verifiying typesType: Probably requires verifiying types
Description
I don't know if an issue already exists for something like this, but at least I couldn't find one:
I suggest to add a lint that checks for conditions such as
i > A || i < B
whereA
andB
are integer literals (or constants?) withA
≤B
(always true)i < A && i > B
whereA
andB
are integer literals (or constants?) withA
≤B
(always false)
After rust-lang/rust#32311 is stabilized, clippy could also suggest to use Range::contains
.
Metadata
Metadata
Assignees
Labels
A-lintArea: New lintsArea: New lintsE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.Call for participation: Medium difficulty level problem and requires some initial experience.T-middleType: Probably requires verifiying typesType: Probably requires verifiying types