2024-03-19 10:59:08 -05:00
|
|
|
error: manual arithmetic check found
|
2024-10-10 12:10:04 -05:00
|
|
|
--> tests/ui/manual_arithmetic_check.rs:9:44
|
2024-03-19 10:59:08 -05:00
|
|
|
|
|
|
|
|
LL | let result = if a > b { a - b } else { 0 };
|
2024-10-10 12:10:04 -05:00
|
|
|
| ^ help: replace it with: `a.saturating_sub(b)`
|
2024-03-19 10:59:08 -05:00
|
|
|
|
|
|
|
|
= note: `-D clippy::implicit-saturating-sub` implied by `-D warnings`
|
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::implicit_saturating_sub)]`
|
|
|
|
|
|
|
|
error: manual arithmetic check found
|
2024-10-10 12:10:04 -05:00
|
|
|
--> tests/ui/manual_arithmetic_check.rs:11:44
|
2024-03-19 10:59:08 -05:00
|
|
|
|
|
|
|
|
LL | let result = if b < a { a - b } else { 0 };
|
2024-10-10 12:10:04 -05:00
|
|
|
| ^ help: replace it with: `a.saturating_sub(b)`
|
2024-03-19 10:59:08 -05:00
|
|
|
|
|
|
|
error: manual arithmetic check found
|
2024-10-10 12:10:04 -05:00
|
|
|
--> tests/ui/manual_arithmetic_check.rs:14:29
|
2024-03-19 10:59:08 -05:00
|
|
|
|
|
|
|
|
LL | let result = if a < b { 0 } else { a - b };
|
2024-10-10 12:10:04 -05:00
|
|
|
| ^ help: replace it with: `a.saturating_sub(b)`
|
2024-03-19 10:59:08 -05:00
|
|
|
|
|
|
|
error: manual arithmetic check found
|
2024-10-10 12:10:04 -05:00
|
|
|
--> tests/ui/manual_arithmetic_check.rs:16:29
|
2024-03-19 10:59:08 -05:00
|
|
|
|
|
|
|
|
LL | let result = if b > a { 0 } else { a - b };
|
2024-10-10 12:10:04 -05:00
|
|
|
| ^ help: replace it with: `a.saturating_sub(b)`
|
2024-03-19 10:59:08 -05:00
|
|
|
|
|
|
|
error: aborting due to 4 previous errors
|
|
|
|
|