11error: this expression can be written more simply using `.retain()`
2- --> $DIR/manual_retain.rs:45 :5
2+ --> $DIR/manual_retain.rs:22 :5
33 |
4- LL | btree_map = btree_map .into_iter().filter(|(k, _)| k % 2 == 0).collect();
5- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_map .retain(|k, _| k % 2 == 0)`
4+ LL | binary_heap = binary_heap .into_iter().filter(|x| x % 2 == 0).collect();
5+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `binary_heap .retain(|x| x % 2 == 0)`
66 |
77 = note: `-D clippy::manual-retain` implied by `-D warnings`
88
99error: this expression can be written more simply using `.retain()`
10- --> $DIR/manual_retain.rs:46:5
10+ --> $DIR/manual_retain.rs:23:5
11+ |
12+ LL | binary_heap = binary_heap.iter().filter(|&x| x % 2 == 0).copied().collect();
13+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `binary_heap.retain(|x| x % 2 == 0)`
14+
15+ error: this expression can be written more simply using `.retain()`
16+ --> $DIR/manual_retain.rs:24:5
17+ |
18+ LL | binary_heap = binary_heap.iter().filter(|&x| x % 2 == 0).cloned().collect();
19+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `binary_heap.retain(|x| x % 2 == 0)`
20+
21+ error: this expression can be written more simply using `.retain()`
22+ --> $DIR/manual_retain.rs:54:5
23+ |
24+ LL | btree_map = btree_map.into_iter().filter(|(k, _)| k % 2 == 0).collect();
25+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_map.retain(|k, _| k % 2 == 0)`
26+
27+ error: this expression can be written more simply using `.retain()`
28+ --> $DIR/manual_retain.rs:55:5
1129 |
1230LL | btree_map = btree_map.into_iter().filter(|(_, v)| v % 2 == 0).collect();
1331 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_map.retain(|_, &mut v| v % 2 == 0)`
1432
1533error: this expression can be written more simply using `.retain()`
16- --> $DIR/manual_retain.rs:47 :5
34+ --> $DIR/manual_retain.rs:56 :5
1735 |
1836LL | / btree_map = btree_map
1937LL | | .into_iter()
@@ -22,37 +40,37 @@ LL | | .collect();
2240 | |__________________^ help: consider calling `.retain()` instead: `btree_map.retain(|k, &mut v| (k % 2 == 0) && (v % 2 == 0))`
2341
2442error: this expression can be written more simply using `.retain()`
25- --> $DIR/manual_retain.rs:69 :5
43+ --> $DIR/manual_retain.rs:78 :5
2644 |
2745LL | btree_set = btree_set.iter().filter(|&x| x % 2 == 0).copied().collect();
2846 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`
2947
3048error: this expression can be written more simply using `.retain()`
31- --> $DIR/manual_retain.rs:70 :5
49+ --> $DIR/manual_retain.rs:79 :5
3250 |
3351LL | btree_set = btree_set.iter().filter(|&x| x % 2 == 0).cloned().collect();
3452 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`
3553
3654error: this expression can be written more simply using `.retain()`
37- --> $DIR/manual_retain.rs:71 :5
55+ --> $DIR/manual_retain.rs:80 :5
3856 |
3957LL | btree_set = btree_set.into_iter().filter(|x| x % 2 == 0).collect();
4058 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`
4159
4260error: this expression can be written more simply using `.retain()`
43- --> $DIR/manual_retain.rs:101 :5
61+ --> $DIR/manual_retain.rs:110 :5
4462 |
4563LL | hash_map = hash_map.into_iter().filter(|(k, _)| k % 2 == 0).collect();
4664 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_map.retain(|k, _| k % 2 == 0)`
4765
4866error: this expression can be written more simply using `.retain()`
49- --> $DIR/manual_retain.rs:102 :5
67+ --> $DIR/manual_retain.rs:111 :5
5068 |
5169LL | hash_map = hash_map.into_iter().filter(|(_, v)| v % 2 == 0).collect();
5270 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_map.retain(|_, &mut v| v % 2 == 0)`
5371
5472error: this expression can be written more simply using `.retain()`
55- --> $DIR/manual_retain.rs:103 :5
73+ --> $DIR/manual_retain.rs:112 :5
5674 |
5775LL | / hash_map = hash_map
5876LL | | .into_iter()
@@ -61,64 +79,64 @@ LL | | .collect();
6179 | |__________________^ help: consider calling `.retain()` instead: `hash_map.retain(|k, &mut v| (k % 2 == 0) && (v % 2 == 0))`
6280
6381error: this expression can be written more simply using `.retain()`
64- --> $DIR/manual_retain.rs:124 :5
82+ --> $DIR/manual_retain.rs:133 :5
6583 |
6684LL | hash_set = hash_set.into_iter().filter(|x| x % 2 == 0).collect();
6785 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`
6886
6987error: this expression can be written more simply using `.retain()`
70- --> $DIR/manual_retain.rs:125 :5
88+ --> $DIR/manual_retain.rs:134 :5
7189 |
7290LL | hash_set = hash_set.iter().filter(|&x| x % 2 == 0).copied().collect();
7391 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`
7492
7593error: this expression can be written more simply using `.retain()`
76- --> $DIR/manual_retain.rs:126 :5
94+ --> $DIR/manual_retain.rs:135 :5
7795 |
7896LL | hash_set = hash_set.iter().filter(|&x| x % 2 == 0).cloned().collect();
7997 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`
8098
8199error: this expression can be written more simply using `.retain()`
82- --> $DIR/manual_retain.rs:155 :5
100+ --> $DIR/manual_retain.rs:164 :5
83101 |
84102LL | s = s.chars().filter(|&c| c != 'o').to_owned().collect();
85103 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `s.retain(|c| c != 'o')`
86104
87105error: this expression can be written more simply using `.retain()`
88- --> $DIR/manual_retain.rs:167 :5
106+ --> $DIR/manual_retain.rs:176 :5
89107 |
90108LL | vec = vec.iter().filter(|&x| x % 2 == 0).copied().collect();
91109 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`
92110
93111error: this expression can be written more simply using `.retain()`
94- --> $DIR/manual_retain.rs:168 :5
112+ --> $DIR/manual_retain.rs:177 :5
95113 |
96114LL | vec = vec.iter().filter(|&x| x % 2 == 0).cloned().collect();
97115 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`
98116
99117error: this expression can be written more simply using `.retain()`
100- --> $DIR/manual_retain.rs:169 :5
118+ --> $DIR/manual_retain.rs:178 :5
101119 |
102120LL | vec = vec.into_iter().filter(|x| x % 2 == 0).collect();
103121 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`
104122
105123error: this expression can be written more simply using `.retain()`
106- --> $DIR/manual_retain.rs:191 :5
124+ --> $DIR/manual_retain.rs:200 :5
107125 |
108126LL | vec_deque = vec_deque.iter().filter(|&x| x % 2 == 0).copied().collect();
109127 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`
110128
111129error: this expression can be written more simply using `.retain()`
112- --> $DIR/manual_retain.rs:192 :5
130+ --> $DIR/manual_retain.rs:201 :5
113131 |
114132LL | vec_deque = vec_deque.iter().filter(|&x| x % 2 == 0).cloned().collect();
115133 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`
116134
117135error: this expression can be written more simply using `.retain()`
118- --> $DIR/manual_retain.rs:193 :5
136+ --> $DIR/manual_retain.rs:202 :5
119137 |
120138LL | vec_deque = vec_deque.into_iter().filter(|x| x % 2 == 0).collect();
121139 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`
122140
123- error: aborting due to 19 previous errors
141+ error: aborting due to 22 previous errors
124142
0 commit comments