rust-clippy/tests/ui-toml/modulo_arithmetic/modulo_arithmetic.rs
Marc Dominik Migge e456c28e11 Don't warn about modulo arithmetic when comparing to zero
Add lint configuration for `modulo_arithmetic`

Collect meta-data
2024-01-25 12:42:53 +01:00

10 lines
178 B
Rust

#![warn(clippy::modulo_arithmetic)]
fn main() {
let a = -1;
let b = 2;
let c = a % b == 0;
let c = a % b != 0;
let c = 0 == a % b;
let c = 0 != a % b;
}