mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
17 lines
402 B
Rust
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;
|
|
}
|