rust-lang/rust-clippy
Ver no GitHubAlways true expressions in if expressions
Open
#1.593 aberto em 3 de mar. de 2017
A-lintL-correctnessT-middlegood first issue
Métricas do repositório
- Stars
- (10.406 stars)
- Métricas de merge de PR
- (Mesclagem média 19d 22h) (113 fundiu PRs em 30d)
Description
I'd like Clippy to find this problem in the code, this expression is always true, and Clippy should also suggest the usage of && here instead:
fn foo1a(name: &str) {
if name != "Min" || name != "Max" {}
}
Another example:
fn foo1b(x: i32) -> bool {
x > 10 || x < 25
}