rust-clippy/tests/ui/manual_rem_euclid.fixed
2022-06-21 14:13:15 -04:00

17 lines
402 B
Rust

// run-rustfix
#![warn(clippy::manual_rem_euclid)]
fn main() {
let value: i32 = 5;
let _: i32 = value.rem_euclid(4);
let _: i32 = value.rem_euclid(4);
let _: i32 = value.rem_euclid(4);
let _: i32 = value.rem_euclid(4);
let _: i32 = 1 + value.rem_euclid(4);
let _: i32 = (3 + value % 4) % 4;
let _: i32 = (-4 + value % -4) % -4;
let _: i32 = ((5 % 4) + 4) % 4;
}