1
1
error: called `unwrap` on `x` after checking its variant with `is_some`
2
- --> $DIR/simple_conditionals.rs:39 :9
2
+ --> $DIR/simple_conditionals.rs:40 :9
3
3
|
4
4
LL | if x.is_some() {
5
5
| -------------- help: try: `if let Some(..) = x`
6
6
LL | x.unwrap(); // unnecessary
7
7
| ^^^^^^^^^^
8
8
|
9
9
note: the lint level is defined here
10
- --> $DIR/simple_conditionals.rs:1 :35
10
+ --> $DIR/simple_conditionals.rs:2 :35
11
11
|
12
12
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
13
13
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
14
14
15
15
error: called `expect` on `x` after checking its variant with `is_some`
16
- --> $DIR/simple_conditionals.rs:40 :9
16
+ --> $DIR/simple_conditionals.rs:41 :9
17
17
|
18
18
LL | if x.is_some() {
19
19
| -------------- help: try: `if let Some(..) = x`
@@ -22,7 +22,7 @@ LL | x.expect("an error message"); // unnecessary
22
22
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23
23
24
24
error: this call to `unwrap()` will always panic
25
- --> $DIR/simple_conditionals.rs:42 :9
25
+ --> $DIR/simple_conditionals.rs:43 :9
26
26
|
27
27
LL | if x.is_some() {
28
28
| ----------- because of this check
@@ -31,13 +31,13 @@ LL | x.unwrap(); // will panic
31
31
| ^^^^^^^^^^
32
32
|
33
33
note: the lint level is defined here
34
- --> $DIR/simple_conditionals.rs:1 :9
34
+ --> $DIR/simple_conditionals.rs:2 :9
35
35
|
36
36
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
37
37
| ^^^^^^^^^^^^^^^^^^^^^^^^
38
38
39
39
error: this call to `expect()` will always panic
40
- --> $DIR/simple_conditionals.rs:43 :9
40
+ --> $DIR/simple_conditionals.rs:44 :9
41
41
|
42
42
LL | if x.is_some() {
43
43
| ----------- because of this check
@@ -46,15 +46,15 @@ LL | x.expect("an error message"); // will panic
46
46
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
47
47
48
48
error: this call to `unwrap()` will always panic
49
- --> $DIR/simple_conditionals.rs:46 :9
49
+ --> $DIR/simple_conditionals.rs:47 :9
50
50
|
51
51
LL | if x.is_none() {
52
52
| ----------- because of this check
53
53
LL | x.unwrap(); // will panic
54
54
| ^^^^^^^^^^
55
55
56
56
error: called `unwrap` on `x` after checking its variant with `is_none`
57
- --> $DIR/simple_conditionals.rs:48 :9
57
+ --> $DIR/simple_conditionals.rs:49 :9
58
58
|
59
59
LL | if x.is_none() {
60
60
| -------------- help: try: `if let Some(..) = x`
@@ -63,7 +63,7 @@ LL | x.unwrap(); // unnecessary
63
63
| ^^^^^^^^^^
64
64
65
65
error: called `unwrap` on `x` after checking its variant with `is_some`
66
- --> $DIR/simple_conditionals.rs:7 :13
66
+ --> $DIR/simple_conditionals.rs:8 :13
67
67
|
68
68
LL | if $a.is_some() {
69
69
| --------------- help: try: `if let Some(..) = x`
@@ -76,15 +76,15 @@ LL | m!(x);
76
76
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
77
77
78
78
error: called `unwrap` on `x` after checking its variant with `is_ok`
79
- --> $DIR/simple_conditionals.rs:56 :9
79
+ --> $DIR/simple_conditionals.rs:57 :9
80
80
|
81
81
LL | if x.is_ok() {
82
82
| ------------ help: try: `if let Ok(..) = x`
83
83
LL | x.unwrap(); // unnecessary
84
84
| ^^^^^^^^^^
85
85
86
86
error: called `expect` on `x` after checking its variant with `is_ok`
87
- --> $DIR/simple_conditionals.rs:57 :9
87
+ --> $DIR/simple_conditionals.rs:58 :9
88
88
|
89
89
LL | if x.is_ok() {
90
90
| ------------ help: try: `if let Ok(..) = x`
@@ -93,7 +93,7 @@ LL | x.expect("an error message"); // unnecessary
93
93
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
94
94
95
95
error: this call to `unwrap_err()` will always panic
96
- --> $DIR/simple_conditionals.rs:58 :9
96
+ --> $DIR/simple_conditionals.rs:59 :9
97
97
|
98
98
LL | if x.is_ok() {
99
99
| --------- because of this check
@@ -102,7 +102,7 @@ LL | x.unwrap_err(); // will panic
102
102
| ^^^^^^^^^^^^^^
103
103
104
104
error: this call to `unwrap()` will always panic
105
- --> $DIR/simple_conditionals.rs:60 :9
105
+ --> $DIR/simple_conditionals.rs:61 :9
106
106
|
107
107
LL | if x.is_ok() {
108
108
| --------- because of this check
@@ -111,7 +111,7 @@ LL | x.unwrap(); // will panic
111
111
| ^^^^^^^^^^
112
112
113
113
error: this call to `expect()` will always panic
114
- --> $DIR/simple_conditionals.rs:61 :9
114
+ --> $DIR/simple_conditionals.rs:62 :9
115
115
|
116
116
LL | if x.is_ok() {
117
117
| --------- because of this check
@@ -120,7 +120,7 @@ LL | x.expect("an error message"); // will panic
120
120
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
121
121
122
122
error: called `unwrap_err` on `x` after checking its variant with `is_ok`
123
- --> $DIR/simple_conditionals.rs:62 :9
123
+ --> $DIR/simple_conditionals.rs:63 :9
124
124
|
125
125
LL | if x.is_ok() {
126
126
| ------------ help: try: `if let Err(..) = x`
@@ -129,15 +129,15 @@ LL | x.unwrap_err(); // unnecessary
129
129
| ^^^^^^^^^^^^^^
130
130
131
131
error: this call to `unwrap()` will always panic
132
- --> $DIR/simple_conditionals.rs:65 :9
132
+ --> $DIR/simple_conditionals.rs:66 :9
133
133
|
134
134
LL | if x.is_err() {
135
135
| ---------- because of this check
136
136
LL | x.unwrap(); // will panic
137
137
| ^^^^^^^^^^
138
138
139
139
error: called `unwrap_err` on `x` after checking its variant with `is_err`
140
- --> $DIR/simple_conditionals.rs:66 :9
140
+ --> $DIR/simple_conditionals.rs:67 :9
141
141
|
142
142
LL | if x.is_err() {
143
143
| ------------- help: try: `if let Err(..) = x`
@@ -146,7 +146,7 @@ LL | x.unwrap_err(); // unnecessary
146
146
| ^^^^^^^^^^^^^^
147
147
148
148
error: called `unwrap` on `x` after checking its variant with `is_err`
149
- --> $DIR/simple_conditionals.rs:68 :9
149
+ --> $DIR/simple_conditionals.rs:69 :9
150
150
|
151
151
LL | if x.is_err() {
152
152
| ------------- help: try: `if let Ok(..) = x`
@@ -155,7 +155,7 @@ LL | x.unwrap(); // unnecessary
155
155
| ^^^^^^^^^^
156
156
157
157
error: this call to `unwrap_err()` will always panic
158
- --> $DIR/simple_conditionals.rs:69 :9
158
+ --> $DIR/simple_conditionals.rs:70 :9
159
159
|
160
160
LL | if x.is_err() {
161
161
| ---------- because of this check
0 commit comments