11error: manual implementation of `Option::filter`
2- --> tests/ui/manual_filter.rs:10 :5
2+ --> tests/ui/manual_filter.rs:11 :5
33 |
44LL | / match Some(0) {
55LL | |
@@ -14,7 +14,7 @@ LL | | };
1414 = help: to override `-D warnings` add `#[allow(clippy::manual_filter)]`
1515
1616error: manual implementation of `Option::filter`
17- --> tests/ui/manual_filter.rs:22 :5
17+ --> tests/ui/manual_filter.rs:23 :5
1818 |
1919LL | / match Some(1) {
2020LL | |
@@ -26,7 +26,7 @@ LL | | };
2626 | |_____^ help: try: `Some(1).filter(|&x| x <= 0)`
2727
2828error: manual implementation of `Option::filter`
29- --> tests/ui/manual_filter.rs:34 :5
29+ --> tests/ui/manual_filter.rs:35 :5
3030 |
3131LL | / match Some(2) {
3232LL | |
@@ -38,7 +38,7 @@ LL | | };
3838 | |_____^ help: try: `Some(2).filter(|&x| x <= 0)`
3939
4040error: manual implementation of `Option::filter`
41- --> tests/ui/manual_filter.rs:46 :5
41+ --> tests/ui/manual_filter.rs:47 :5
4242 |
4343LL | / match Some(3) {
4444LL | |
@@ -50,7 +50,7 @@ LL | | };
5050 | |_____^ help: try: `Some(3).filter(|&x| x > 0)`
5151
5252error: manual implementation of `Option::filter`
53- --> tests/ui/manual_filter.rs:59 :5
53+ --> tests/ui/manual_filter.rs:60 :5
5454 |
5555LL | / match y {
5656LL | |
@@ -62,7 +62,7 @@ LL | | };
6262 | |_____^ help: try: `y.filter(|&x| x <= 0)`
6363
6464error: manual implementation of `Option::filter`
65- --> tests/ui/manual_filter.rs:72 :5
65+ --> tests/ui/manual_filter.rs:73 :5
6666 |
6767LL | / match Some(5) {
6868LL | |
@@ -74,7 +74,7 @@ LL | | };
7474 | |_____^ help: try: `Some(5).filter(|&x| x > 0)`
7575
7676error: manual implementation of `Option::filter`
77- --> tests/ui/manual_filter.rs:84 :5
77+ --> tests/ui/manual_filter.rs:85 :5
7878 |
7979LL | / match Some(6) {
8080LL | |
@@ -86,7 +86,7 @@ LL | | };
8686 | |_____^ help: try: `Some(6).as_ref().filter(|&x| x > &0)`
8787
8888error: manual implementation of `Option::filter`
89- --> tests/ui/manual_filter.rs:97 :5
89+ --> tests/ui/manual_filter.rs:98 :5
9090 |
9191LL | / match Some(String::new()) {
9292LL | |
@@ -98,7 +98,7 @@ LL | | };
9898 | |_____^ help: try: `Some(String::new()).filter(|x| external_cond)`
9999
100100error: manual implementation of `Option::filter`
101- --> tests/ui/manual_filter.rs:109 :5
101+ --> tests/ui/manual_filter.rs:110 :5
102102 |
103103LL | / if let Some(x) = Some(7) {
104104LL | |
@@ -109,7 +109,7 @@ LL | | };
109109 | |_____^ help: try: `Some(7).filter(|&x| external_cond)`
110110
111111error: manual implementation of `Option::filter`
112- --> tests/ui/manual_filter.rs:116 :5
112+ --> tests/ui/manual_filter.rs:117 :5
113113 |
114114LL | / match &Some(8) {
115115LL | |
@@ -121,7 +121,7 @@ LL | | };
121121 | |_____^ help: try: `Some(8).filter(|&x| x != 0)`
122122
123123error: manual implementation of `Option::filter`
124- --> tests/ui/manual_filter.rs:128 :5
124+ --> tests/ui/manual_filter.rs:129 :5
125125 |
126126LL | / match Some(9) {
127127LL | |
@@ -133,7 +133,7 @@ LL | | };
133133 | |_____^ help: try: `Some(9).filter(|&x| x > 10 && x < 100)`
134134
135135error: manual implementation of `Option::filter`
136- --> tests/ui/manual_filter.rs:155 :5
136+ --> tests/ui/manual_filter.rs:156 :5
137137 |
138138LL | / match Some(11) {
139139LL | |
@@ -153,7 +153,7 @@ LL ~ });
153153 |
154154
155155error: manual implementation of `Option::filter`
156- --> tests/ui/manual_filter.rs:200 :13
156+ --> tests/ui/manual_filter.rs:201 :13
157157 |
158158LL | let _ = match Some(14) {
159159 | _____________^
@@ -166,7 +166,7 @@ LL | | };
166166 | |_____^ help: try: `Some(14).filter(|&x| unsafe { f(x) })`
167167
168168error: manual implementation of `Option::filter`
169- --> tests/ui/manual_filter.rs:211 :13
169+ --> tests/ui/manual_filter.rs:212 :13
170170 |
171171LL | let _ = match Some(15) {
172172 | _____________^
@@ -177,7 +177,7 @@ LL | | };
177177 | |_____^ help: try: `Some(15).filter(|&x| unsafe { f(x) })`
178178
179179error: manual implementation of `Option::filter`
180- --> tests/ui/manual_filter.rs:220 :12
180+ --> tests/ui/manual_filter.rs:221 :12
181181 |
182182LL | } else if let Some(x) = Some(16) {
183183 | ____________^
@@ -190,31 +190,31 @@ LL | | };
190190 | |_____^ help: try: `{ Some(16).filter(|&x| x % 2 == 0) }`
191191
192192error: manual implementation of `Option::filter`
193- --> tests/ui/manual_filter.rs:303 :9
193+ --> tests/ui/manual_filter.rs:304 :9
194194 |
195195LL | opt.and_then(|x| if x == 0 { None } else { Some(x) });
196196 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `filter(|&x| x != 0)`
197197
198198error: manual implementation of `Option::filter`
199- --> tests/ui/manual_filter.rs:307 :9
199+ --> tests/ui/manual_filter.rs:308 :9
200200 |
201201LL | opt.and_then(move |x| if x == y { Some(x) } else { None });
202202 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `filter(move |&x| x == y)`
203203
204204error: manual implementation of `Option::filter`
205- --> tests/ui/manual_filter.rs:311 :10
205+ --> tests/ui/manual_filter.rs:312 :10
206206 |
207207LL | opt1.and_then(|s| if s.len() > 2 { Some(s) } else { None });
208208 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `filter(|s| s.len() > 2)`
209209
210210error: manual implementation of `Option::filter`
211- --> tests/ui/manual_filter.rs:317 :9
211+ --> tests/ui/manual_filter.rs:318 :9
212212 |
213213LL | opt.and_then(|x| if unsafe { f(x as u32) } { Some(x) } else { None });
214214 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `filter(|&x| unsafe { f(x as u32) })`
215215
216216error: manual implementation of `Option::filter`
217- --> tests/ui/manual_filter.rs:319 :9
217+ --> tests/ui/manual_filter.rs:320 :9
218218 |
219219LL | opt.and_then(|x| unsafe { if f(x as u32) { Some(x) } else { None } });
220220 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `filter(|&x| unsafe { f(x as u32) })`
0 commit comments