2024-03-19 10:59:08 -05:00
|
|
|
error: manual arithmetic check found
|
2024-10-11 14:10:34 -05:00
|
|
|
--> tests/ui/manual_arithmetic_check.rs:9:18
|
2024-03-19 10:59:08 -05:00
|
|
|
|
|
|
|
|
LL | let result = if a > b { a - b } else { 0 };
|
2024-10-11 14:10:34 -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-11 14:10:34 -05:00
|
|
|
--> tests/ui/manual_arithmetic_check.rs:11:18
|
2024-03-19 10:59:08 -05:00
|
|
|
|
|
|
|
|
LL | let result = if b < a { a - b } else { 0 };
|
2024-10-11 14:10:34 -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-11 14:10:34 -05:00
|
|
|
--> tests/ui/manual_arithmetic_check.rs:14:18
|
2024-03-19 10:59:08 -05:00
|
|
|
|
|
|
|
|
LL | let result = if a < b { 0 } else { a - b };
|
2024-10-11 14:10:34 -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-11 14:10:34 -05:00
|
|
|
--> tests/ui/manual_arithmetic_check.rs:16:18
|
2024-03-19 10:59:08 -05:00
|
|
|
|
|
|
|
|
LL | let result = if b > a { 0 } else { a - b };
|
2024-10-11 14:10:34 -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
|
|
|
|
|