11error: redundant pattern matching, consider using `is_none()`
2- --> $DIR/redundant_pattern_matching_option.rs:15 :12
2+ --> $DIR/redundant_pattern_matching_option.rs:19 :12
33 |
44LL | if let None = None::<()> {}
55 | -------^^^^------------- help: try: `if None::<()>.is_none()`
66 |
77 = note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
88
99error: redundant pattern matching, consider using `is_some()`
10- --> $DIR/redundant_pattern_matching_option.rs:17 :12
10+ --> $DIR/redundant_pattern_matching_option.rs:21 :12
1111 |
1212LL | if let Some(_) = Some(42) {}
1313 | -------^^^^^^^----------- help: try: `if Some(42).is_some()`
1414
1515error: redundant pattern matching, consider using `is_some()`
16- --> $DIR/redundant_pattern_matching_option.rs:19 :12
16+ --> $DIR/redundant_pattern_matching_option.rs:23 :12
1717 |
1818LL | if let Some(_) = Some(42) {
1919 | -------^^^^^^^----------- help: try: `if Some(42).is_some()`
2020
2121error: redundant pattern matching, consider using `is_some()`
22- --> $DIR/redundant_pattern_matching_option.rs:25 :15
22+ --> $DIR/redundant_pattern_matching_option.rs:29 :15
2323 |
2424LL | while let Some(_) = Some(42) {}
2525 | ----------^^^^^^^----------- help: try: `while Some(42).is_some()`
2626
2727error: redundant pattern matching, consider using `is_none()`
28- --> $DIR/redundant_pattern_matching_option.rs:27 :15
28+ --> $DIR/redundant_pattern_matching_option.rs:31 :15
2929 |
3030LL | while let None = Some(42) {}
3131 | ----------^^^^----------- help: try: `while Some(42).is_none()`
3232
3333error: redundant pattern matching, consider using `is_none()`
34- --> $DIR/redundant_pattern_matching_option.rs:29 :15
34+ --> $DIR/redundant_pattern_matching_option.rs:33 :15
3535 |
3636LL | while let None = None::<()> {}
3737 | ----------^^^^------------- help: try: `while None::<()>.is_none()`
3838
3939error: redundant pattern matching, consider using `is_some()`
40- --> $DIR/redundant_pattern_matching_option.rs:32 :15
40+ --> $DIR/redundant_pattern_matching_option.rs:36 :15
4141 |
4242LL | while let Some(_) = v.pop() {
4343 | ----------^^^^^^^---------- help: try: `while v.pop().is_some()`
4444
4545error: redundant pattern matching, consider using `is_some()`
46- --> $DIR/redundant_pattern_matching_option.rs:40 :5
46+ --> $DIR/redundant_pattern_matching_option.rs:44 :5
4747 |
4848LL | / match Some(42) {
4949LL | | Some(_) => true,
@@ -52,7 +52,7 @@ LL | | };
5252 | |_____^ help: try: `Some(42).is_some()`
5353
5454error: redundant pattern matching, consider using `is_none()`
55- --> $DIR/redundant_pattern_matching_option.rs:45 :5
55+ --> $DIR/redundant_pattern_matching_option.rs:49 :5
5656 |
5757LL | / match None::<()> {
5858LL | | Some(_) => false,
@@ -61,7 +61,7 @@ LL | | };
6161 | |_____^ help: try: `None::<()>.is_none()`
6262
6363error: redundant pattern matching, consider using `is_none()`
64- --> $DIR/redundant_pattern_matching_option.rs:50 :13
64+ --> $DIR/redundant_pattern_matching_option.rs:54 :13
6565 |
6666LL | let _ = match None::<()> {
6767 | _____________^
@@ -71,55 +71,55 @@ LL | | };
7171 | |_____^ help: try: `None::<()>.is_none()`
7272
7373error: redundant pattern matching, consider using `is_some()`
74- --> $DIR/redundant_pattern_matching_option.rs:56 :20
74+ --> $DIR/redundant_pattern_matching_option.rs:60 :20
7575 |
7676LL | let _ = if let Some(_) = opt { true } else { false };
7777 | -------^^^^^^^------ help: try: `if opt.is_some()`
7878
7979error: redundant pattern matching, consider using `is_some()`
80- --> $DIR/redundant_pattern_matching_option.rs:62 :20
80+ --> $DIR/redundant_pattern_matching_option.rs:66 :20
8181 |
8282LL | let _ = if let Some(_) = gen_opt() {
8383 | -------^^^^^^^------------ help: try: `if gen_opt().is_some()`
8484
8585error: redundant pattern matching, consider using `is_none()`
86- --> $DIR/redundant_pattern_matching_option.rs:64 :19
86+ --> $DIR/redundant_pattern_matching_option.rs:68 :19
8787 |
8888LL | } else if let None = gen_opt() {
8989 | -------^^^^------------ help: try: `if gen_opt().is_none()`
9090
9191error: redundant pattern matching, consider using `is_some()`
92- --> $DIR/redundant_pattern_matching_option.rs:70 :12
92+ --> $DIR/redundant_pattern_matching_option.rs:74 :12
9393 |
9494LL | if let Some(..) = gen_opt() {}
9595 | -------^^^^^^^^------------ help: try: `if gen_opt().is_some()`
9696
9797error: redundant pattern matching, consider using `is_some()`
98- --> $DIR/redundant_pattern_matching_option.rs:85 :12
98+ --> $DIR/redundant_pattern_matching_option.rs:89 :12
9999 |
100100LL | if let Some(_) = Some(42) {}
101101 | -------^^^^^^^----------- help: try: `if Some(42).is_some()`
102102
103103error: redundant pattern matching, consider using `is_none()`
104- --> $DIR/redundant_pattern_matching_option.rs:87 :12
104+ --> $DIR/redundant_pattern_matching_option.rs:91 :12
105105 |
106106LL | if let None = None::<()> {}
107107 | -------^^^^------------- help: try: `if None::<()>.is_none()`
108108
109109error: redundant pattern matching, consider using `is_some()`
110- --> $DIR/redundant_pattern_matching_option.rs:89 :15
110+ --> $DIR/redundant_pattern_matching_option.rs:93 :15
111111 |
112112LL | while let Some(_) = Some(42) {}
113113 | ----------^^^^^^^----------- help: try: `while Some(42).is_some()`
114114
115115error: redundant pattern matching, consider using `is_none()`
116- --> $DIR/redundant_pattern_matching_option.rs:91 :15
116+ --> $DIR/redundant_pattern_matching_option.rs:95 :15
117117 |
118118LL | while let None = None::<()> {}
119119 | ----------^^^^------------- help: try: `while None::<()>.is_none()`
120120
121121error: redundant pattern matching, consider using `is_some()`
122- --> $DIR/redundant_pattern_matching_option.rs:93 :5
122+ --> $DIR/redundant_pattern_matching_option.rs:97 :5
123123 |
124124LL | / match Some(42) {
125125LL | | Some(_) => true,
@@ -128,7 +128,7 @@ LL | | };
128128 | |_____^ help: try: `Some(42).is_some()`
129129
130130error: redundant pattern matching, consider using `is_none()`
131- --> $DIR/redundant_pattern_matching_option.rs:98 :5
131+ --> $DIR/redundant_pattern_matching_option.rs:102 :5
132132 |
133133LL | / match None::<()> {
134134LL | | Some(_) => false,
@@ -137,19 +137,19 @@ LL | | };
137137 | |_____^ help: try: `None::<()>.is_none()`
138138
139139error: redundant pattern matching, consider using `is_none()`
140- --> $DIR/redundant_pattern_matching_option.rs:106 :12
140+ --> $DIR/redundant_pattern_matching_option.rs:110 :12
141141 |
142142LL | if let None = *(&None::<()>) {}
143143 | -------^^^^----------------- help: try: `if (&None::<()>).is_none()`
144144
145145error: redundant pattern matching, consider using `is_none()`
146- --> $DIR/redundant_pattern_matching_option.rs:107 :12
146+ --> $DIR/redundant_pattern_matching_option.rs:111 :12
147147 |
148148LL | if let None = *&None::<()> {}
149149 | -------^^^^--------------- help: try: `if (&None::<()>).is_none()`
150150
151151error: redundant pattern matching, consider using `is_some()`
152- --> $DIR/redundant_pattern_matching_option.rs:113 :5
152+ --> $DIR/redundant_pattern_matching_option.rs:117 :5
153153 |
154154LL | / match x {
155155LL | | Some(_) => true,
@@ -158,7 +158,7 @@ LL | | };
158158 | |_____^ help: try: `x.is_some()`
159159
160160error: redundant pattern matching, consider using `is_none()`
161- --> $DIR/redundant_pattern_matching_option.rs:118 :5
161+ --> $DIR/redundant_pattern_matching_option.rs:122 :5
162162 |
163163LL | / match x {
164164LL | | None => true,
@@ -167,7 +167,7 @@ LL | | };
167167 | |_____^ help: try: `x.is_none()`
168168
169169error: redundant pattern matching, consider using `is_none()`
170- --> $DIR/redundant_pattern_matching_option.rs:123 :5
170+ --> $DIR/redundant_pattern_matching_option.rs:127 :5
171171 |
172172LL | / match x {
173173LL | | Some(_) => false,
@@ -176,7 +176,7 @@ LL | | };
176176 | |_____^ help: try: `x.is_none()`
177177
178178error: redundant pattern matching, consider using `is_some()`
179- --> $DIR/redundant_pattern_matching_option.rs:128 :5
179+ --> $DIR/redundant_pattern_matching_option.rs:132 :5
180180 |
181181LL | / match x {
182182LL | | None => false,
@@ -185,13 +185,13 @@ LL | | };
185185 | |_____^ help: try: `x.is_some()`
186186
187187error: redundant pattern matching, consider using `is_some()`
188- --> $DIR/redundant_pattern_matching_option.rs:143 :13
188+ --> $DIR/redundant_pattern_matching_option.rs:147 :13
189189 |
190190LL | let _ = matches!(x, Some(_));
191191 | ^^^^^^^^^^^^^^^^^^^^ help: try: `x.is_some()`
192192
193193error: redundant pattern matching, consider using `is_none()`
194- --> $DIR/redundant_pattern_matching_option.rs:145 :13
194+ --> $DIR/redundant_pattern_matching_option.rs:149 :13
195195 |
196196LL | let _ = matches!(x, None);
197197 | ^^^^^^^^^^^^^^^^^ help: try: `x.is_none()`
0 commit comments