1 error: this expression can be written more simply using `.retain()`
2 --> $DIR/manual_retain.rs:51:5
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)`
7 = note: `-D clippy::manual-retain` implied by `-D warnings`
9 error: this expression can be written more simply using `.retain()`
10 --> $DIR/manual_retain.rs:52:5
12 LL | btree_map = btree_map.into_iter().filter(|(_, v)| v % 2 == 0).collect();
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_map.retain(|_, &mut v| v % 2 == 0)`
15 error: this expression can be written more simply using `.retain()`
16 --> $DIR/manual_retain.rs:53:5
18 LL | / btree_map = btree_map
20 LL | | .filter(|(k, v)| (k % 2 == 0) && (v % 2 == 0))
22 | |__________________^ help: consider calling `.retain()` instead: `btree_map.retain(|k, &mut v| (k % 2 == 0) && (v % 2 == 0))`
24 error: this expression can be written more simply using `.retain()`
25 --> $DIR/manual_retain.rs:75:5
27 LL | btree_set = btree_set.iter().filter(|&x| x % 2 == 0).copied().collect();
28 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`
30 error: this expression can be written more simply using `.retain()`
31 --> $DIR/manual_retain.rs:76:5
33 LL | btree_set = btree_set.iter().filter(|&x| x % 2 == 0).cloned().collect();
34 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`
36 error: this expression can be written more simply using `.retain()`
37 --> $DIR/manual_retain.rs:77:5
39 LL | btree_set = btree_set.into_iter().filter(|x| x % 2 == 0).collect();
40 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`
42 error: this expression can be written more simply using `.retain()`
43 --> $DIR/manual_retain.rs:107:5
45 LL | hash_map = hash_map.into_iter().filter(|(k, _)| k % 2 == 0).collect();
46 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_map.retain(|k, _| k % 2 == 0)`
48 error: this expression can be written more simply using `.retain()`
49 --> $DIR/manual_retain.rs:108:5
51 LL | hash_map = hash_map.into_iter().filter(|(_, v)| v % 2 == 0).collect();
52 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_map.retain(|_, &mut v| v % 2 == 0)`
54 error: this expression can be written more simply using `.retain()`
55 --> $DIR/manual_retain.rs:109:5
57 LL | / hash_map = hash_map
59 LL | | .filter(|(k, v)| (k % 2 == 0) && (v % 2 == 0))
61 | |__________________^ help: consider calling `.retain()` instead: `hash_map.retain(|k, &mut v| (k % 2 == 0) && (v % 2 == 0))`
63 error: this expression can be written more simply using `.retain()`
64 --> $DIR/manual_retain.rs:130:5
66 LL | hash_set = hash_set.into_iter().filter(|x| x % 2 == 0).collect();
67 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`
69 error: this expression can be written more simply using `.retain()`
70 --> $DIR/manual_retain.rs:131:5
72 LL | hash_set = hash_set.iter().filter(|&x| x % 2 == 0).copied().collect();
73 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`
75 error: this expression can be written more simply using `.retain()`
76 --> $DIR/manual_retain.rs:132:5
78 LL | hash_set = hash_set.iter().filter(|&x| x % 2 == 0).cloned().collect();
79 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`
81 error: this expression can be written more simply using `.retain()`
82 --> $DIR/manual_retain.rs:161:5
84 LL | s = s.chars().filter(|&c| c != 'o').to_owned().collect();
85 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `s.retain(|c| c != 'o')`
87 error: this expression can be written more simply using `.retain()`
88 --> $DIR/manual_retain.rs:173:5
90 LL | vec = vec.iter().filter(|&x| x % 2 == 0).copied().collect();
91 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`
93 error: this expression can be written more simply using `.retain()`
94 --> $DIR/manual_retain.rs:174:5
96 LL | vec = vec.iter().filter(|&x| x % 2 == 0).cloned().collect();
97 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`
99 error: this expression can be written more simply using `.retain()`
100 --> $DIR/manual_retain.rs:175:5
102 LL | vec = vec.into_iter().filter(|x| x % 2 == 0).collect();
103 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`
105 error: this expression can be written more simply using `.retain()`
106 --> $DIR/manual_retain.rs:197:5
108 LL | vec_deque = vec_deque.iter().filter(|&x| x % 2 == 0).copied().collect();
109 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`
111 error: this expression can be written more simply using `.retain()`
112 --> $DIR/manual_retain.rs:198:5
114 LL | vec_deque = vec_deque.iter().filter(|&x| x % 2 == 0).cloned().collect();
115 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`
117 error: this expression can be written more simply using `.retain()`
118 --> $DIR/manual_retain.rs:199:5
120 LL | vec_deque = vec_deque.into_iter().filter(|x| x % 2 == 0).collect();
121 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`
123 error: aborting due to 19 previous errors