|
1 | | -error: Checked cast can be simplified: `u32::try_from` |
2 | | - --> $DIR/checked_conversions.rs:9:8 |
| 1 | +error: Checked cast can be simplified. |
| 2 | + --> $DIR/checked_conversions.rs:13:8 |
3 | 3 | | |
4 | 4 | LL | if value <= (u32::max_value() as i64) && value >= 0 { |
5 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `u32::try_from(value).is_ok()` |
6 | 6 | | |
7 | 7 | = note: `-D clippy::checked-conversions` implied by `-D warnings` |
8 | 8 |
|
9 | | -error: Checked cast can be simplified: `u16::try_from` |
10 | | - --> $DIR/checked_conversions.rs:17:8 |
| 9 | +error: Checked cast can be simplified. |
| 10 | + --> $DIR/checked_conversions.rs:21:8 |
11 | 11 | | |
12 | 12 | LL | if value <= i64::from(u16::max_value()) && value >= 0 { |
13 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 13 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `u16::try_from(value).is_ok()` |
14 | 14 |
|
15 | | -error: Checked cast can be simplified: `u8::try_from` |
16 | | - --> $DIR/checked_conversions.rs:25:8 |
| 15 | +error: Checked cast can be simplified. |
| 16 | + --> $DIR/checked_conversions.rs:29:8 |
17 | 17 | | |
18 | 18 | LL | if value <= (u8::max_value() as isize) && value >= 0 { |
19 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 19 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `u8::try_from(value).is_ok()` |
20 | 20 |
|
21 | | -error: Checked cast can be simplified: `i32::try_from` |
22 | | - --> $DIR/checked_conversions.rs:35:8 |
| 21 | +error: Checked cast can be simplified. |
| 22 | + --> $DIR/checked_conversions.rs:39:8 |
23 | 23 | | |
24 | 24 | LL | if value <= (i32::max_value() as i64) && value >= (i32::min_value() as i64) { |
25 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 25 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `i32::try_from(value).is_ok()` |
26 | 26 |
|
27 | | -error: Checked cast can be simplified: `i16::try_from` |
28 | | - --> $DIR/checked_conversions.rs:43:8 |
| 27 | +error: Checked cast can be simplified. |
| 28 | + --> $DIR/checked_conversions.rs:47:8 |
29 | 29 | | |
30 | 30 | LL | if value <= i64::from(i16::max_value()) && value >= i64::from(i16::min_value()) { |
31 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 31 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `i16::try_from(value).is_ok()` |
32 | 32 |
|
33 | | -error: Checked cast can be simplified: `i32::try_from` |
34 | | - --> $DIR/checked_conversions.rs:53:8 |
| 33 | +error: Checked cast can be simplified. |
| 34 | + --> $DIR/checked_conversions.rs:57:8 |
35 | 35 | | |
36 | 36 | LL | if value <= i32::max_value() as u32 { |
37 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 37 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `i32::try_from(value).is_ok()` |
38 | 38 |
|
39 | | -error: Checked cast can be simplified: `isize::try_from` |
40 | | - --> $DIR/checked_conversions.rs:61:8 |
| 39 | +error: Checked cast can be simplified. |
| 40 | + --> $DIR/checked_conversions.rs:65:8 |
41 | 41 | | |
42 | 42 | LL | if value <= isize::max_value() as usize && value as i32 == 5 { |
43 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 43 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `isize::try_from(value).is_ok()` |
44 | 44 |
|
45 | | -error: Checked cast can be simplified: `u16::try_from` |
46 | | - --> $DIR/checked_conversions.rs:69:8 |
| 45 | +error: Checked cast can be simplified. |
| 46 | + --> $DIR/checked_conversions.rs:73:8 |
47 | 47 | | |
48 | 48 | LL | if value <= u16::max_value() as u32 && value as i32 == 5 { |
49 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 49 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `u16::try_from(value).is_ok()` |
50 | 50 |
|
51 | 51 | error: aborting due to 8 previous errors |
52 | 52 |
|
0 commit comments