1 error: manual implementation of `Option::filter`
2 --> $DIR/manual_filter.rs:7:5
11 | |_____^ help: try this: `Some(0).filter(|&x| x <= 0)`
13 = note: `-D clippy::manual-filter` implied by `-D warnings`
15 error: manual implementation of `Option::filter`
16 --> $DIR/manual_filter.rs:18:5
18 LL | / match Some(1) {
25 | |_____^ help: try this: `Some(1).filter(|&x| x <= 0)`
27 error: manual implementation of `Option::filter`
28 --> $DIR/manual_filter.rs:29:5
30 LL | / match Some(2) {
37 | |_____^ help: try this: `Some(2).filter(|&x| x <= 0)`
39 error: manual implementation of `Option::filter`
40 --> $DIR/manual_filter.rs:40:5
42 LL | / match Some(3) {
49 | |_____^ help: try this: `Some(3).filter(|&x| x > 0)`
51 error: manual implementation of `Option::filter`
52 --> $DIR/manual_filter.rs:52:5
61 | |_____^ help: try this: `y.filter(|&x| x <= 0)`
63 error: manual implementation of `Option::filter`
64 --> $DIR/manual_filter.rs:64:5
66 LL | / match Some(5) {
73 | |_____^ help: try this: `Some(5).filter(|&x| x > 0)`
75 error: manual implementation of `Option::filter`
76 --> $DIR/manual_filter.rs:75:5
78 LL | / match Some(6) {
79 LL | | Some(ref x) => {
85 | |_____^ help: try this: `Some(6).as_ref().filter(|&x| x > &0)`
87 error: manual implementation of `Option::filter`
88 --> $DIR/manual_filter.rs:87:5
90 LL | / match Some(String::new()) {
92 LL | | if external_cond {
97 | |_____^ help: try this: `Some(String::new()).filter(|x| external_cond)`
99 error: manual implementation of `Option::filter`
100 --> $DIR/manual_filter.rs:98:5
102 LL | / if let Some(x) = Some(7) {
103 LL | | if external_cond { Some(x) } else { None }
107 | |_____^ help: try this: `Some(7).filter(|&x| external_cond)`
109 error: manual implementation of `Option::filter`
110 --> $DIR/manual_filter.rs:104:5
112 LL | / match &Some(8) {
119 | |_____^ help: try this: `Some(8).filter(|&x| x != 0)`
121 error: manual implementation of `Option::filter`
122 --> $DIR/manual_filter.rs:115:5
124 LL | / match Some(9) {
126 LL | | if x > 10 && x < 100 {
131 | |_____^ help: try this: `Some(9).filter(|&x| x > 10 && x < 100)`
133 error: manual implementation of `Option::filter`
134 --> $DIR/manual_filter.rs:141:5
136 LL | / match Some(11) {
137 LL | | // Lint, statement is preserved by `.filter`
147 LL ~ Some(11).filter(|&x| {
148 LL + println!("foo");
149 LL + x > 10 && x < 100
153 error: manual implementation of `Option::filter`
154 --> $DIR/manual_filter.rs:185:13
156 LL | let _ = match Some(14) {
159 LL | | if unsafe { f(x) } {
164 | |_____^ help: try this: `Some(14).filter(|&x| unsafe { f(x) })`
166 error: manual implementation of `Option::filter`
167 --> $DIR/manual_filter.rs:195:13
169 LL | let _ = match Some(15) {
171 LL | | Some(x) => unsafe {
172 LL | | if f(x) { Some(x) } else { None }
176 | |_____^ help: try this: `Some(15).filter(|&x| unsafe { f(x) })`
178 error: manual implementation of `Option::filter`
179 --> $DIR/manual_filter.rs:205:12
181 LL | } else if let Some(x) = Some(16) {
183 LL | | // Lint starting from here
184 LL | | if x % 2 == 0 { Some(x) } else { None }
188 | |_____^ help: try this: `{ Some(16).filter(|&x| x % 2 == 0) }`
190 error: aborting due to 15 previous errors