mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-24 03:53:20 +00:00
17 lines
433 B
Rust
17 lines
433 B
Rust
|
#![warn(clippy::implicit_saturating_sub)]
|
||
|
|
||
|
fn main() {
|
||
|
let a = 12u32;
|
||
|
let b = 13u32;
|
||
|
|
||
|
let result = a.saturating_sub(b);
|
||
|
//~^ ERROR: manual arithmetic check found
|
||
|
let result = a.saturating_sub(b);
|
||
|
//~^ ERROR: manual arithmetic check found
|
||
|
|
||
|
let result = a.saturating_sub(b);
|
||
|
//~^ ERROR: manual arithmetic check found
|
||
|
let result = a.saturating_sub(b);
|
||
|
//~^ ERROR: manual arithmetic check found
|
||
|
}
|