1
1
error: this expression can be written more simply using `.retain()`
2
- --> tests/ui/manual_retain.rs:27 :5
2
+ --> tests/ui/manual_retain.rs:25 :5
3
3
|
4
4
LL | binary_heap = binary_heap.into_iter().filter(|x| x % 2 == 0).collect();
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `binary_heap.retain(|x| x % 2 == 0)`
@@ -8,43 +8,43 @@ LL | binary_heap = binary_heap.into_iter().filter(|x| x % 2 == 0).collect();
8
8
= help: to override `-D warnings` add `#[allow(clippy::manual_retain)]`
9
9
10
10
error: this expression can be written more simply using `.retain()`
11
- --> tests/ui/manual_retain.rs:28 :5
11
+ --> tests/ui/manual_retain.rs:26 :5
12
12
|
13
13
LL | binary_heap = binary_heap.iter().filter(|&x| x % 2 == 0).copied().collect();
14
14
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `binary_heap.retain(|x| x % 2 == 0)`
15
15
16
16
error: this expression can be written more simply using `.retain()`
17
- --> tests/ui/manual_retain.rs:29 :5
17
+ --> tests/ui/manual_retain.rs:27 :5
18
18
|
19
19
LL | binary_heap = binary_heap.iter().filter(|&x| x % 2 == 0).cloned().collect();
20
20
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `binary_heap.retain(|x| x % 2 == 0)`
21
21
22
22
error: this expression can be written more simply using `.retain()`
23
- --> tests/ui/manual_retain.rs:33 :5
23
+ --> tests/ui/manual_retain.rs:31 :5
24
24
|
25
25
LL | tuples = tuples.iter().filter(|(ref x, ref y)| *x == 0).copied().collect();
26
26
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `tuples.retain(|(ref x, ref y)| *x == 0)`
27
27
28
28
error: this expression can be written more simply using `.retain()`
29
- --> tests/ui/manual_retain.rs:34 :5
29
+ --> tests/ui/manual_retain.rs:32 :5
30
30
|
31
31
LL | tuples = tuples.iter().filter(|(x, y)| *x == 0).copied().collect();
32
32
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `tuples.retain(|(x, y)| *x == 0)`
33
33
34
34
error: this expression can be written more simply using `.retain()`
35
- --> tests/ui/manual_retain.rs:64 :5
35
+ --> tests/ui/manual_retain.rs:62 :5
36
36
|
37
37
LL | btree_map = btree_map.into_iter().filter(|(k, _)| k % 2 == 0).collect();
38
38
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_map.retain(|k, _| k % 2 == 0)`
39
39
40
40
error: this expression can be written more simply using `.retain()`
41
- --> tests/ui/manual_retain.rs:65 :5
41
+ --> tests/ui/manual_retain.rs:63 :5
42
42
|
43
43
LL | btree_map = btree_map.into_iter().filter(|(_, v)| v % 2 == 0).collect();
44
44
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_map.retain(|_, &mut v| v % 2 == 0)`
45
45
46
46
error: this expression can be written more simply using `.retain()`
47
- --> tests/ui/manual_retain.rs:66 :5
47
+ --> tests/ui/manual_retain.rs:64 :5
48
48
|
49
49
LL | / btree_map = btree_map
50
50
LL | | .into_iter()
@@ -53,49 +53,49 @@ LL | | .collect();
53
53
| |__________________^ help: consider calling `.retain()` instead: `btree_map.retain(|k, &mut v| (k % 2 == 0) && (v % 2 == 0))`
54
54
55
55
error: this expression can be written more simply using `.retain()`
56
- --> tests/ui/manual_retain.rs:91 :5
56
+ --> tests/ui/manual_retain.rs:89 :5
57
57
|
58
58
LL | btree_set = btree_set.iter().filter(|&x| x % 2 == 0).copied().collect();
59
59
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`
60
60
61
61
error: this expression can be written more simply using `.retain()`
62
- --> tests/ui/manual_retain.rs:92 :5
62
+ --> tests/ui/manual_retain.rs:90 :5
63
63
|
64
64
LL | btree_set = btree_set.iter().filter(|&x| x % 2 == 0).cloned().collect();
65
65
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`
66
66
67
67
error: this expression can be written more simply using `.retain()`
68
- --> tests/ui/manual_retain.rs:93 :5
68
+ --> tests/ui/manual_retain.rs:91 :5
69
69
|
70
70
LL | btree_set = btree_set.into_iter().filter(|x| x % 2 == 0).collect();
71
71
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`
72
72
73
73
error: this expression can be written more simply using `.retain()`
74
- --> tests/ui/manual_retain.rs:97 :5
74
+ --> tests/ui/manual_retain.rs:95 :5
75
75
|
76
76
LL | tuples = tuples.iter().filter(|(ref x, ref y)| *x == 0).copied().collect();
77
77
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `tuples.retain(|(ref x, ref y)| *x == 0)`
78
78
79
79
error: this expression can be written more simply using `.retain()`
80
- --> tests/ui/manual_retain.rs:98 :5
80
+ --> tests/ui/manual_retain.rs:96 :5
81
81
|
82
82
LL | tuples = tuples.iter().filter(|(x, y)| *x == 0).copied().collect();
83
83
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `tuples.retain(|(x, y)| *x == 0)`
84
84
85
85
error: this expression can be written more simply using `.retain()`
86
- --> tests/ui/manual_retain.rs:128 :5
86
+ --> tests/ui/manual_retain.rs:126 :5
87
87
|
88
88
LL | hash_map = hash_map.into_iter().filter(|(k, _)| k % 2 == 0).collect();
89
89
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_map.retain(|k, _| k % 2 == 0)`
90
90
91
91
error: this expression can be written more simply using `.retain()`
92
- --> tests/ui/manual_retain.rs:129 :5
92
+ --> tests/ui/manual_retain.rs:127 :5
93
93
|
94
94
LL | hash_map = hash_map.into_iter().filter(|(_, v)| v % 2 == 0).collect();
95
95
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_map.retain(|_, &mut v| v % 2 == 0)`
96
96
97
97
error: this expression can be written more simply using `.retain()`
98
- --> tests/ui/manual_retain.rs:130 :5
98
+ --> tests/ui/manual_retain.rs:128 :5
99
99
|
100
100
LL | / hash_map = hash_map
101
101
LL | | .into_iter()
@@ -104,133 +104,133 @@ LL | | .collect();
104
104
| |__________________^ help: consider calling `.retain()` instead: `hash_map.retain(|k, &mut v| (k % 2 == 0) && (v % 2 == 0))`
105
105
106
106
error: this expression can be written more simply using `.retain()`
107
- --> tests/ui/manual_retain.rs:154 :5
107
+ --> tests/ui/manual_retain.rs:152 :5
108
108
|
109
109
LL | hash_set = hash_set.into_iter().filter(|x| x % 2 == 0).collect();
110
110
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`
111
111
112
112
error: this expression can be written more simply using `.retain()`
113
- --> tests/ui/manual_retain.rs:155 :5
113
+ --> tests/ui/manual_retain.rs:153 :5
114
114
|
115
115
LL | hash_set = hash_set.iter().filter(|&x| x % 2 == 0).copied().collect();
116
116
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`
117
117
118
118
error: this expression can be written more simply using `.retain()`
119
- --> tests/ui/manual_retain.rs:156 :5
119
+ --> tests/ui/manual_retain.rs:154 :5
120
120
|
121
121
LL | hash_set = hash_set.iter().filter(|&x| x % 2 == 0).cloned().collect();
122
122
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`
123
123
124
124
error: this expression can be written more simply using `.retain()`
125
- --> tests/ui/manual_retain.rs:160 :5
125
+ --> tests/ui/manual_retain.rs:158 :5
126
126
|
127
127
LL | tuples = tuples.iter().filter(|(ref x, ref y)| *x == 0).copied().collect();
128
128
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `tuples.retain(|(ref x, ref y)| *x == 0)`
129
129
130
130
error: this expression can be written more simply using `.retain()`
131
- --> tests/ui/manual_retain.rs:161 :5
131
+ --> tests/ui/manual_retain.rs:159 :5
132
132
|
133
133
LL | tuples = tuples.iter().filter(|(x, y)| *x == 0).copied().collect();
134
134
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `tuples.retain(|(x, y)| *x == 0)`
135
135
136
136
error: this expression can be written more simply using `.retain()`
137
- --> tests/ui/manual_retain.rs:190 :5
137
+ --> tests/ui/manual_retain.rs:188 :5
138
138
|
139
139
LL | s = s.chars().filter(|&c| c != 'o').to_owned().collect();
140
140
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `s.retain(|c| c != 'o')`
141
141
142
142
error: this expression can be written more simply using `.retain()`
143
- --> tests/ui/manual_retain.rs:202 :5
143
+ --> tests/ui/manual_retain.rs:200 :5
144
144
|
145
145
LL | vec = vec.iter().filter(|&x| x % 2 == 0).copied().collect();
146
146
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`
147
147
148
148
error: this expression can be written more simply using `.retain()`
149
- --> tests/ui/manual_retain.rs:203 :5
149
+ --> tests/ui/manual_retain.rs:201 :5
150
150
|
151
151
LL | vec = vec.iter().filter(|&x| x % 2 == 0).cloned().collect();
152
152
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`
153
153
154
154
error: this expression can be written more simply using `.retain()`
155
- --> tests/ui/manual_retain.rs:204 :5
155
+ --> tests/ui/manual_retain.rs:202 :5
156
156
|
157
157
LL | vec = vec.into_iter().filter(|x| x % 2 == 0).collect();
158
158
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`
159
159
160
160
error: this expression can be written more simply using `.retain()`
161
- --> tests/ui/manual_retain.rs:208 :5
161
+ --> tests/ui/manual_retain.rs:206 :5
162
162
|
163
163
LL | tuples = tuples.iter().filter(|(ref x, ref y)| *x == 0).copied().collect();
164
164
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `tuples.retain(|(ref x, ref y)| *x == 0)`
165
165
166
166
error: this expression can be written more simply using `.retain()`
167
- --> tests/ui/manual_retain.rs:209 :5
167
+ --> tests/ui/manual_retain.rs:207 :5
168
168
|
169
169
LL | tuples = tuples.iter().filter(|(x, y)| *x == 0).copied().collect();
170
170
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `tuples.retain(|(x, y)| *x == 0)`
171
171
172
172
error: this expression can be written more simply using `.retain()`
173
- --> tests/ui/manual_retain.rs:231 :5
173
+ --> tests/ui/manual_retain.rs:229 :5
174
174
|
175
175
LL | vec_deque = vec_deque.iter().filter(|&x| x % 2 == 0).copied().collect();
176
176
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`
177
177
178
178
error: this expression can be written more simply using `.retain()`
179
- --> tests/ui/manual_retain.rs:232 :5
179
+ --> tests/ui/manual_retain.rs:230 :5
180
180
|
181
181
LL | vec_deque = vec_deque.iter().filter(|&x| x % 2 == 0).cloned().collect();
182
182
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`
183
183
184
184
error: this expression can be written more simply using `.retain()`
185
- --> tests/ui/manual_retain.rs:233 :5
185
+ --> tests/ui/manual_retain.rs:231 :5
186
186
|
187
187
LL | vec_deque = vec_deque.into_iter().filter(|x| x % 2 == 0).collect();
188
188
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`
189
189
190
190
error: this expression can be written more simply using `.retain()`
191
- --> tests/ui/manual_retain.rs:290 :5
191
+ --> tests/ui/manual_retain.rs:288 :5
192
192
|
193
193
LL | vec = vec.into_iter().filter(|(x, y)| *x == 0).collect();
194
194
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|(x, y)| *x == 0)`
195
195
196
196
error: this expression can be written more simply using `.retain()`
197
- --> tests/ui/manual_retain.rs:294 :5
197
+ --> tests/ui/manual_retain.rs:292 :5
198
198
|
199
199
LL | tuples = tuples.into_iter().filter(|(_, n)| *n > 0).collect();
200
200
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `tuples.retain(|(_, n)| *n > 0)`
201
201
202
202
error: this expression can be written more simply using `.retain()`
203
- --> tests/ui/manual_retain.rs:311 :5
203
+ --> tests/ui/manual_retain.rs:309 :5
204
204
|
205
205
LL | vec = vec.iter().filter(|&&x| x == 0).copied().collect();
206
206
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|&x| x == 0)`
207
207
208
208
error: this expression can be written more simply using `.retain()`
209
- --> tests/ui/manual_retain.rs:312 :5
209
+ --> tests/ui/manual_retain.rs:310 :5
210
210
|
211
211
LL | vec = vec.iter().filter(|&&x| x == 0).cloned().collect();
212
212
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|&x| x == 0)`
213
213
214
214
error: this expression can be written more simply using `.retain()`
215
- --> tests/ui/manual_retain.rs:313 :5
215
+ --> tests/ui/manual_retain.rs:311 :5
216
216
|
217
217
LL | vec = vec.into_iter().filter(|&x| x == 0).collect();
218
218
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|&x| x == 0)`
219
219
220
220
error: this expression can be written more simply using `.retain()`
221
- --> tests/ui/manual_retain.rs:316 :5
221
+ --> tests/ui/manual_retain.rs:314 :5
222
222
|
223
223
LL | vec = vec.iter().filter(|&x| *x == 0).copied().collect();
224
224
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| *x == 0)`
225
225
226
226
error: this expression can be written more simply using `.retain()`
227
- --> tests/ui/manual_retain.rs:317 :5
227
+ --> tests/ui/manual_retain.rs:315 :5
228
228
|
229
229
LL | vec = vec.iter().filter(|&x| *x == 0).cloned().collect();
230
230
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| *x == 0)`
231
231
232
232
error: this expression can be written more simply using `.retain()`
233
- --> tests/ui/manual_retain.rs:318 :5
233
+ --> tests/ui/manual_retain.rs:316 :5
234
234
|
235
235
LL | vec = vec.into_iter().filter(|x| *x == 0).collect();
236
236
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| *x == 0)`
0 commit comments