1
1
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
2
- --> $DIR/simple_conditionals.rs:7 :9
2
+ --> $DIR/simple_conditionals.rs:15 :9
3
3
|
4
4
LL | if x.is_some() {
5
5
| ----------- the check is happening here
@@ -13,7 +13,7 @@ LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
13
13
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
14
14
15
15
error: This call to `unwrap()` will always panic.
16
- --> $DIR/simple_conditionals.rs:9 :9
16
+ --> $DIR/simple_conditionals.rs:17 :9
17
17
|
18
18
LL | if x.is_some() {
19
19
| ----------- because of this check
@@ -28,15 +28,15 @@ LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
28
28
| ^^^^^^^^^^^^^^^^^^^^^^^^
29
29
30
30
error: This call to `unwrap()` will always panic.
31
- --> $DIR/simple_conditionals.rs:12 :9
31
+ --> $DIR/simple_conditionals.rs:20 :9
32
32
|
33
33
LL | if x.is_none() {
34
34
| ----------- because of this check
35
35
LL | x.unwrap(); // will panic
36
36
| ^^^^^^^^^^
37
37
38
38
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
39
- --> $DIR/simple_conditionals.rs:14 :9
39
+ --> $DIR/simple_conditionals.rs:22 :9
40
40
|
41
41
LL | if x.is_none() {
42
42
| ----------- the check is happening here
@@ -45,15 +45,26 @@ LL | x.unwrap(); // unnecessary
45
45
| ^^^^^^^^^^
46
46
47
47
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
48
- --> $DIR/simple_conditionals.rs:18:9
48
+ --> $DIR/simple_conditionals.rs:7:13
49
+ |
50
+ LL | if $a.is_some() {
51
+ | ------------ the check is happening here
52
+ LL | $a.unwrap(); // unnecessary
53
+ | ^^^^^^^^^^^
54
+ ...
55
+ LL | m!(x);
56
+ | ------ in this macro invocation
57
+
58
+ error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
59
+ --> $DIR/simple_conditionals.rs:27:9
49
60
|
50
61
LL | if x.is_ok() {
51
62
| --------- the check is happening here
52
63
LL | x.unwrap(); // unnecessary
53
64
| ^^^^^^^^^^
54
65
55
66
error: This call to `unwrap_err()` will always panic.
56
- --> $DIR/simple_conditionals.rs:19 :9
67
+ --> $DIR/simple_conditionals.rs:28 :9
57
68
|
58
69
LL | if x.is_ok() {
59
70
| --------- because of this check
@@ -62,7 +73,7 @@ LL | x.unwrap_err(); // will panic
62
73
| ^^^^^^^^^^^^^^
63
74
64
75
error: This call to `unwrap()` will always panic.
65
- --> $DIR/simple_conditionals.rs:21 :9
76
+ --> $DIR/simple_conditionals.rs:30 :9
66
77
|
67
78
LL | if x.is_ok() {
68
79
| --------- because of this check
@@ -71,7 +82,7 @@ LL | x.unwrap(); // will panic
71
82
| ^^^^^^^^^^
72
83
73
84
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
74
- --> $DIR/simple_conditionals.rs:22 :9
85
+ --> $DIR/simple_conditionals.rs:31 :9
75
86
|
76
87
LL | if x.is_ok() {
77
88
| --------- the check is happening here
@@ -80,15 +91,15 @@ LL | x.unwrap_err(); // unnecessary
80
91
| ^^^^^^^^^^^^^^
81
92
82
93
error: This call to `unwrap()` will always panic.
83
- --> $DIR/simple_conditionals.rs:25 :9
94
+ --> $DIR/simple_conditionals.rs:34 :9
84
95
|
85
96
LL | if x.is_err() {
86
97
| ---------- because of this check
87
98
LL | x.unwrap(); // will panic
88
99
| ^^^^^^^^^^
89
100
90
101
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
91
- --> $DIR/simple_conditionals.rs:26 :9
102
+ --> $DIR/simple_conditionals.rs:35 :9
92
103
|
93
104
LL | if x.is_err() {
94
105
| ---------- the check is happening here
@@ -97,7 +108,7 @@ LL | x.unwrap_err(); // unnecessary
97
108
| ^^^^^^^^^^^^^^
98
109
99
110
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
100
- --> $DIR/simple_conditionals.rs:28 :9
111
+ --> $DIR/simple_conditionals.rs:37 :9
101
112
|
102
113
LL | if x.is_err() {
103
114
| ---------- the check is happening here
@@ -106,13 +117,13 @@ LL | x.unwrap(); // unnecessary
106
117
| ^^^^^^^^^^
107
118
108
119
error: This call to `unwrap_err()` will always panic.
109
- --> $DIR/simple_conditionals.rs:29 :9
120
+ --> $DIR/simple_conditionals.rs:38 :9
110
121
|
111
122
LL | if x.is_err() {
112
123
| ---------- because of this check
113
124
...
114
125
LL | x.unwrap_err(); // will panic
115
126
| ^^^^^^^^^^^^^^
116
127
117
- error: aborting due to 12 previous errors
128
+ error: aborting due to 13 previous errors
118
129
0 commit comments