Skip to content

Commit e22ca03

Browse files
committed
Auto merge of #12452 - CBSpeir:dedup-manual-retain, r=blyxyas
[`manual_retain`]: Fix duplicate diagnostics Relates to: #12379 The first lint guard executed in `LateLintPass::check_expr` was testing if the parent was of type `ExprKind::Assign`. This meant the lint emitted on both sides of the assignment operator when `check_expr` is called on either `Expr`. The guard in the fix only lints once when the `Expr` is of kind `Assign`. changelog: Fix duplicate lint diagnostic emission from [`manual_retain`]
2 parents f685a4b + ed6e629 commit e22ca03

File tree

4 files changed

+43
-48
lines changed

4 files changed

+43
-48
lines changed

Diff for: clippy_lints/src/manual_retain.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use clippy_config::msrvs::{self, Msrv};
22
use clippy_utils::diagnostics::span_lint_and_sugg;
33
use clippy_utils::source::snippet;
44
use clippy_utils::ty::{is_type_diagnostic_item, is_type_lang_item};
5-
use clippy_utils::{get_parent_expr, match_def_path, paths, SpanlessEq};
5+
use clippy_utils::{match_def_path, paths, SpanlessEq};
66
use rustc_errors::Applicability;
77
use rustc_hir as hir;
88
use rustc_hir::def_id::DefId;
@@ -69,17 +69,16 @@ impl_lint_pass!(ManualRetain => [MANUAL_RETAIN]);
6969

7070
impl<'tcx> LateLintPass<'tcx> for ManualRetain {
7171
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) {
72-
if let Some(parent_expr) = get_parent_expr(cx, expr)
73-
&& let Assign(left_expr, collect_expr, _) = &parent_expr.kind
72+
if let Assign(left_expr, collect_expr, _) = &expr.kind
7473
&& let hir::ExprKind::MethodCall(seg, ..) = &collect_expr.kind
7574
&& seg.args.is_none()
7675
&& let hir::ExprKind::MethodCall(_, target_expr, [], _) = &collect_expr.kind
7776
&& let Some(collect_def_id) = cx.typeck_results().type_dependent_def_id(collect_expr.hir_id)
7877
&& cx.tcx.is_diagnostic_item(sym::iterator_collect_fn, collect_def_id)
7978
{
80-
check_into_iter(cx, left_expr, target_expr, parent_expr.span, &self.msrv);
81-
check_iter(cx, left_expr, target_expr, parent_expr.span, &self.msrv);
82-
check_to_owned(cx, left_expr, target_expr, parent_expr.span, &self.msrv);
79+
check_into_iter(cx, left_expr, target_expr, expr.span, &self.msrv);
80+
check_iter(cx, left_expr, target_expr, expr.span, &self.msrv);
81+
check_to_owned(cx, left_expr, target_expr, expr.span, &self.msrv);
8382
}
8483
}
8584

Diff for: tests/ui/manual_retain.fixed

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//@compile-flags: -Zdeduplicate-diagnostics=yes
2-
31
#![warn(clippy::manual_retain)]
42
#![allow(unused, clippy::redundant_clone)]
53
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};

Diff for: tests/ui/manual_retain.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//@compile-flags: -Zdeduplicate-diagnostics=yes
2-
31
#![warn(clippy::manual_retain)]
42
#![allow(unused, clippy::redundant_clone)]
53
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};

Diff for: tests/ui/manual_retain.stderr

+38-38
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
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
33
|
44
LL | binary_heap = binary_heap.into_iter().filter(|x| x % 2 == 0).collect();
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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();
88
= help: to override `-D warnings` add `#[allow(clippy::manual_retain)]`
99

1010
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
1212
|
1313
LL | binary_heap = binary_heap.iter().filter(|&x| x % 2 == 0).copied().collect();
1414
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `binary_heap.retain(|x| x % 2 == 0)`
1515

1616
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
1818
|
1919
LL | binary_heap = binary_heap.iter().filter(|&x| x % 2 == 0).cloned().collect();
2020
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `binary_heap.retain(|x| x % 2 == 0)`
2121

2222
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
2424
|
2525
LL | tuples = tuples.iter().filter(|(ref x, ref y)| *x == 0).copied().collect();
2626
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `tuples.retain(|(ref x, ref y)| *x == 0)`
2727

2828
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
3030
|
3131
LL | tuples = tuples.iter().filter(|(x, y)| *x == 0).copied().collect();
3232
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `tuples.retain(|(x, y)| *x == 0)`
3333

3434
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
3636
|
3737
LL | btree_map = btree_map.into_iter().filter(|(k, _)| k % 2 == 0).collect();
3838
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_map.retain(|k, _| k % 2 == 0)`
3939

4040
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
4242
|
4343
LL | btree_map = btree_map.into_iter().filter(|(_, v)| v % 2 == 0).collect();
4444
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_map.retain(|_, &mut v| v % 2 == 0)`
4545

4646
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
4848
|
4949
LL | / btree_map = btree_map
5050
LL | | .into_iter()
@@ -53,49 +53,49 @@ LL | | .collect();
5353
| |__________________^ help: consider calling `.retain()` instead: `btree_map.retain(|k, &mut v| (k % 2 == 0) && (v % 2 == 0))`
5454

5555
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
5757
|
5858
LL | btree_set = btree_set.iter().filter(|&x| x % 2 == 0).copied().collect();
5959
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`
6060

6161
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
6363
|
6464
LL | btree_set = btree_set.iter().filter(|&x| x % 2 == 0).cloned().collect();
6565
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`
6666

6767
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
6969
|
7070
LL | btree_set = btree_set.into_iter().filter(|x| x % 2 == 0).collect();
7171
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`
7272

7373
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
7575
|
7676
LL | tuples = tuples.iter().filter(|(ref x, ref y)| *x == 0).copied().collect();
7777
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `tuples.retain(|(ref x, ref y)| *x == 0)`
7878

7979
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
8181
|
8282
LL | tuples = tuples.iter().filter(|(x, y)| *x == 0).copied().collect();
8383
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `tuples.retain(|(x, y)| *x == 0)`
8484

8585
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
8787
|
8888
LL | hash_map = hash_map.into_iter().filter(|(k, _)| k % 2 == 0).collect();
8989
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_map.retain(|k, _| k % 2 == 0)`
9090

9191
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
9393
|
9494
LL | hash_map = hash_map.into_iter().filter(|(_, v)| v % 2 == 0).collect();
9595
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_map.retain(|_, &mut v| v % 2 == 0)`
9696

9797
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
9999
|
100100
LL | / hash_map = hash_map
101101
LL | | .into_iter()
@@ -104,133 +104,133 @@ LL | | .collect();
104104
| |__________________^ help: consider calling `.retain()` instead: `hash_map.retain(|k, &mut v| (k % 2 == 0) && (v % 2 == 0))`
105105

106106
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
108108
|
109109
LL | hash_set = hash_set.into_iter().filter(|x| x % 2 == 0).collect();
110110
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`
111111

112112
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
114114
|
115115
LL | hash_set = hash_set.iter().filter(|&x| x % 2 == 0).copied().collect();
116116
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`
117117

118118
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
120120
|
121121
LL | hash_set = hash_set.iter().filter(|&x| x % 2 == 0).cloned().collect();
122122
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`
123123

124124
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
126126
|
127127
LL | tuples = tuples.iter().filter(|(ref x, ref y)| *x == 0).copied().collect();
128128
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `tuples.retain(|(ref x, ref y)| *x == 0)`
129129

130130
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
132132
|
133133
LL | tuples = tuples.iter().filter(|(x, y)| *x == 0).copied().collect();
134134
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `tuples.retain(|(x, y)| *x == 0)`
135135

136136
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
138138
|
139139
LL | s = s.chars().filter(|&c| c != 'o').to_owned().collect();
140140
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `s.retain(|c| c != 'o')`
141141

142142
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
144144
|
145145
LL | vec = vec.iter().filter(|&x| x % 2 == 0).copied().collect();
146146
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`
147147

148148
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
150150
|
151151
LL | vec = vec.iter().filter(|&x| x % 2 == 0).cloned().collect();
152152
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`
153153

154154
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
156156
|
157157
LL | vec = vec.into_iter().filter(|x| x % 2 == 0).collect();
158158
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`
159159

160160
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
162162
|
163163
LL | tuples = tuples.iter().filter(|(ref x, ref y)| *x == 0).copied().collect();
164164
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `tuples.retain(|(ref x, ref y)| *x == 0)`
165165

166166
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
168168
|
169169
LL | tuples = tuples.iter().filter(|(x, y)| *x == 0).copied().collect();
170170
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `tuples.retain(|(x, y)| *x == 0)`
171171

172172
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
174174
|
175175
LL | vec_deque = vec_deque.iter().filter(|&x| x % 2 == 0).copied().collect();
176176
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`
177177

178178
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
180180
|
181181
LL | vec_deque = vec_deque.iter().filter(|&x| x % 2 == 0).cloned().collect();
182182
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`
183183

184184
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
186186
|
187187
LL | vec_deque = vec_deque.into_iter().filter(|x| x % 2 == 0).collect();
188188
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`
189189

190190
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
192192
|
193193
LL | vec = vec.into_iter().filter(|(x, y)| *x == 0).collect();
194194
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|(x, y)| *x == 0)`
195195

196196
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
198198
|
199199
LL | tuples = tuples.into_iter().filter(|(_, n)| *n > 0).collect();
200200
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `tuples.retain(|(_, n)| *n > 0)`
201201

202202
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
204204
|
205205
LL | vec = vec.iter().filter(|&&x| x == 0).copied().collect();
206206
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|&x| x == 0)`
207207

208208
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
210210
|
211211
LL | vec = vec.iter().filter(|&&x| x == 0).cloned().collect();
212212
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|&x| x == 0)`
213213

214214
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
216216
|
217217
LL | vec = vec.into_iter().filter(|&x| x == 0).collect();
218218
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|&x| x == 0)`
219219

220220
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
222222
|
223223
LL | vec = vec.iter().filter(|&x| *x == 0).copied().collect();
224224
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| *x == 0)`
225225

226226
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
228228
|
229229
LL | vec = vec.iter().filter(|&x| *x == 0).cloned().collect();
230230
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| *x == 0)`
231231

232232
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
234234
|
235235
LL | vec = vec.into_iter().filter(|x| *x == 0).collect();
236236
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| *x == 0)`

0 commit comments

Comments
 (0)