1
1
error: consider using `NonZeroU64::from()` for more efficient and type-safe conversion
2
- --> tests/ui/non_zero_suggestions.rs:11 :18
2
+ --> tests/ui/non_zero_suggestions.rs:10 :18
3
3
|
4
4
LL | let r1 = x / u64::from(y.get());
5
5
| ^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroU64::from(y)`
@@ -8,52 +8,58 @@ LL | let r1 = x / u64::from(y.get());
8
8
= help: to override `-D warnings` add `#[allow(clippy::non_zero_suggestions)]`
9
9
10
10
error: consider using `NonZeroU64::from()` for more efficient and type-safe conversion
11
- --> tests/ui/non_zero_suggestions.rs:12 :18
11
+ --> tests/ui/non_zero_suggestions.rs:13 :18
12
12
|
13
13
LL | let r2 = x % u64::from(y.get());
14
14
| ^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroU64::from(y)`
15
15
16
16
error: consider using `NonZeroU32::from()` for more efficient and type-safe conversion
17
- --> tests/ui/non_zero_suggestions.rs:17 :18
17
+ --> tests/ui/non_zero_suggestions.rs:19 :18
18
18
|
19
19
LL | let r3 = a / u32::from(b.get());
20
20
| ^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroU32::from(b)`
21
21
22
22
error: consider using `NonZeroI16::from()` for more efficient and type-safe conversion
23
- --> tests/ui/non_zero_suggestions.rs:22 :14
23
+ --> tests/ui/non_zero_suggestions.rs:25 :14
24
24
|
25
25
LL | let r4 = i16::from(d.get());
26
26
| ^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroI16::from(d)`
27
27
28
28
error: consider using `NonZeroU64::from()` for more efficient and type-safe conversion
29
- --> tests/ui/non_zero_suggestions.rs:27 :18
29
+ --> tests/ui/non_zero_suggestions.rs:31 :18
30
30
|
31
31
LL | let r5 = m / u64::from(n.get());
32
32
| ^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroU64::from(n)`
33
33
34
34
error: consider using `NonZeroU64::from()` for more efficient and type-safe conversion
35
- --> tests/ui/non_zero_suggestions.rs:33 :14
35
+ --> tests/ui/non_zero_suggestions.rs:37 :14
36
36
|
37
37
LL | let r6 = u64::from(max_u32.get());
38
38
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroU64::from(max_u32)`
39
39
40
40
error: consider using `NonZeroU64::from()` for more efficient and type-safe conversion
41
- --> tests/ui/non_zero_suggestions.rs:36 :13
41
+ --> tests/ui/non_zero_suggestions.rs:41 :13
42
42
|
43
43
LL | let _ = u64::from(NonZeroU32::new(10).unwrap().get());
44
44
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroU64::from(NonZeroU32::new(10).unwrap())`
45
45
46
46
error: consider using `NonZeroU64::from()` for more efficient and type-safe conversion
47
- --> tests/ui/non_zero_suggestions.rs:58 :9
47
+ --> tests/ui/non_zero_suggestions.rs:63 :9
48
48
|
49
49
LL | x / u64::from(y.get())
50
50
| ^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroU64::from(y)`
51
51
52
52
error: consider using `NonZeroU64::from()` for more efficient and type-safe conversion
53
- --> tests/ui/non_zero_suggestions.rs:67:22
53
+ --> tests/ui/non_zero_suggestions.rs:68:5
54
+ |
55
+ LL | u64::from(y.get())
56
+ | ^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroU64::from(y)`
57
+
58
+ error: consider using `NonZeroU64::from()` for more efficient and type-safe conversion
59
+ --> tests/ui/non_zero_suggestions.rs:80:22
54
60
|
55
61
LL | self.value / u64::from(divisor.get())
56
62
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `NonZeroU64::from(divisor)`
57
63
58
- error: aborting due to 9 previous errors
64
+ error: aborting due to 10 previous errors
59
65
0 commit comments