11error: 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
33 |
44LL | if x.is_some() {
55 | -------------- help: try: `if let Some(..) = x`
66LL | x.unwrap(); // unnecessary
77 | ^^^^^^^^^^
88 |
99note: the lint level is defined here
10- --> $DIR/simple_conditionals.rs:1 :35
10+ --> $DIR/simple_conditionals.rs:2 :35
1111 |
1212LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
1313 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
1414
1515error: 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
1717 |
1818LL | if x.is_some() {
1919 | -------------- help: try: `if let Some(..) = x`
@@ -22,7 +22,7 @@ LL | x.expect("an error message"); // unnecessary
2222 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2323
2424error: this call to `unwrap()` will always panic
25- --> $DIR/simple_conditionals.rs:42 :9
25+ --> $DIR/simple_conditionals.rs:43 :9
2626 |
2727LL | if x.is_some() {
2828 | ----------- because of this check
@@ -31,13 +31,13 @@ LL | x.unwrap(); // will panic
3131 | ^^^^^^^^^^
3232 |
3333note: the lint level is defined here
34- --> $DIR/simple_conditionals.rs:1 :9
34+ --> $DIR/simple_conditionals.rs:2 :9
3535 |
3636LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
3737 | ^^^^^^^^^^^^^^^^^^^^^^^^
3838
3939error: this call to `expect()` will always panic
40- --> $DIR/simple_conditionals.rs:43 :9
40+ --> $DIR/simple_conditionals.rs:44 :9
4141 |
4242LL | if x.is_some() {
4343 | ----------- because of this check
@@ -46,15 +46,15 @@ LL | x.expect("an error message"); // will panic
4646 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4747
4848error: this call to `unwrap()` will always panic
49- --> $DIR/simple_conditionals.rs:46 :9
49+ --> $DIR/simple_conditionals.rs:47 :9
5050 |
5151LL | if x.is_none() {
5252 | ----------- because of this check
5353LL | x.unwrap(); // will panic
5454 | ^^^^^^^^^^
5555
5656error: 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
5858 |
5959LL | if x.is_none() {
6060 | -------------- help: try: `if let Some(..) = x`
@@ -63,7 +63,7 @@ LL | x.unwrap(); // unnecessary
6363 | ^^^^^^^^^^
6464
6565error: 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
6767 |
6868LL | if $a.is_some() {
6969 | --------------- help: try: `if let Some(..) = x`
@@ -76,15 +76,15 @@ LL | m!(x);
7676 = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
7777
7878error: 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
8080 |
8181LL | if x.is_ok() {
8282 | ------------ help: try: `if let Ok(..) = x`
8383LL | x.unwrap(); // unnecessary
8484 | ^^^^^^^^^^
8585
8686error: 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
8888 |
8989LL | if x.is_ok() {
9090 | ------------ help: try: `if let Ok(..) = x`
@@ -93,7 +93,7 @@ LL | x.expect("an error message"); // unnecessary
9393 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9494
9595error: this call to `unwrap_err()` will always panic
96- --> $DIR/simple_conditionals.rs:58 :9
96+ --> $DIR/simple_conditionals.rs:59 :9
9797 |
9898LL | if x.is_ok() {
9999 | --------- because of this check
@@ -102,7 +102,7 @@ LL | x.unwrap_err(); // will panic
102102 | ^^^^^^^^^^^^^^
103103
104104error: this call to `unwrap()` will always panic
105- --> $DIR/simple_conditionals.rs:60 :9
105+ --> $DIR/simple_conditionals.rs:61 :9
106106 |
107107LL | if x.is_ok() {
108108 | --------- because of this check
@@ -111,7 +111,7 @@ LL | x.unwrap(); // will panic
111111 | ^^^^^^^^^^
112112
113113error: this call to `expect()` will always panic
114- --> $DIR/simple_conditionals.rs:61 :9
114+ --> $DIR/simple_conditionals.rs:62 :9
115115 |
116116LL | if x.is_ok() {
117117 | --------- because of this check
@@ -120,7 +120,7 @@ LL | x.expect("an error message"); // will panic
120120 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
121121
122122error: 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
124124 |
125125LL | if x.is_ok() {
126126 | ------------ help: try: `if let Err(..) = x`
@@ -129,15 +129,15 @@ LL | x.unwrap_err(); // unnecessary
129129 | ^^^^^^^^^^^^^^
130130
131131error: this call to `unwrap()` will always panic
132- --> $DIR/simple_conditionals.rs:65 :9
132+ --> $DIR/simple_conditionals.rs:66 :9
133133 |
134134LL | if x.is_err() {
135135 | ---------- because of this check
136136LL | x.unwrap(); // will panic
137137 | ^^^^^^^^^^
138138
139139error: 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
141141 |
142142LL | if x.is_err() {
143143 | ------------- help: try: `if let Err(..) = x`
@@ -146,7 +146,7 @@ LL | x.unwrap_err(); // unnecessary
146146 | ^^^^^^^^^^^^^^
147147
148148error: 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
150150 |
151151LL | if x.is_err() {
152152 | ------------- help: try: `if let Ok(..) = x`
@@ -155,7 +155,7 @@ LL | x.unwrap(); // unnecessary
155155 | ^^^^^^^^^^
156156
157157error: this call to `unwrap_err()` will always panic
158- --> $DIR/simple_conditionals.rs:69 :9
158+ --> $DIR/simple_conditionals.rs:70 :9
159159 |
160160LL | if x.is_err() {
161161 | ---------- because of this check
0 commit comments