1
1
error: this expression can be written more simply using `.retain()`
2
- --> $DIR/manual_retain.rs:23 :5
2
+ --> $DIR/manual_retain.rs:22 :5
3
3
|
4
- LL | heap = heap .into_iter().filter(|x| x % 2 == 0).collect();
5
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `heap .retain(|x| x % 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)`
6
6
|
7
7
= note: `-D clippy::manual-retain` implied by `-D warnings`
8
8
9
9
error: this expression can be written more simply using `.retain()`
10
- --> $DIR/manual_retain.rs:24 :5
10
+ --> $DIR/manual_retain.rs:23 :5
11
11
|
12
- LL | heap = heap .iter().filter(|&x| x % 2 == 0).copied().collect();
13
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `heap .retain(|x| x % 2 == 0)`
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
14
15
15
error: this expression can be written more simply using `.retain()`
16
- --> $DIR/manual_retain.rs:25 :5
16
+ --> $DIR/manual_retain.rs:24 :5
17
17
|
18
- LL | heap = heap .iter().filter(|&x| x % 2 == 0).cloned().collect();
19
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `heap .retain(|x| x % 2 == 0)`
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
20
21
21
error: this expression can be written more simply using `.retain()`
22
- --> $DIR/manual_retain.rs:44 :5
22
+ --> $DIR/manual_retain.rs:54 :5
23
23
|
24
24
LL | btree_map = btree_map.into_iter().filter(|(k, _)| k % 2 == 0).collect();
25
25
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_map.retain(|k, _| k % 2 == 0)`
26
26
27
27
error: this expression can be written more simply using `.retain()`
28
- --> $DIR/manual_retain.rs:45 :5
28
+ --> $DIR/manual_retain.rs:55 :5
29
29
|
30
30
LL | btree_map = btree_map.into_iter().filter(|(_, v)| v % 2 == 0).collect();
31
31
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_map.retain(|_, &mut v| v % 2 == 0)`
32
32
33
33
error: this expression can be written more simply using `.retain()`
34
- --> $DIR/manual_retain.rs:46 :5
34
+ --> $DIR/manual_retain.rs:56 :5
35
35
|
36
36
LL | / btree_map = btree_map
37
37
LL | | .into_iter()
@@ -40,37 +40,37 @@ LL | | .collect();
40
40
| |__________________^ help: consider calling `.retain()` instead: `btree_map.retain(|k, &mut v| (k % 2 == 0) && (v % 2 == 0))`
41
41
42
42
error: this expression can be written more simply using `.retain()`
43
- --> $DIR/manual_retain.rs:68 :5
43
+ --> $DIR/manual_retain.rs:78 :5
44
44
|
45
45
LL | btree_set = btree_set.iter().filter(|&x| x % 2 == 0).copied().collect();
46
46
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`
47
47
48
48
error: this expression can be written more simply using `.retain()`
49
- --> $DIR/manual_retain.rs:69 :5
49
+ --> $DIR/manual_retain.rs:79 :5
50
50
|
51
51
LL | btree_set = btree_set.iter().filter(|&x| x % 2 == 0).cloned().collect();
52
52
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`
53
53
54
54
error: this expression can be written more simply using `.retain()`
55
- --> $DIR/manual_retain.rs:70 :5
55
+ --> $DIR/manual_retain.rs:80 :5
56
56
|
57
57
LL | btree_set = btree_set.into_iter().filter(|x| x % 2 == 0).collect();
58
58
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`
59
59
60
60
error: this expression can be written more simply using `.retain()`
61
- --> $DIR/manual_retain.rs:100 :5
61
+ --> $DIR/manual_retain.rs:110 :5
62
62
|
63
63
LL | hash_map = hash_map.into_iter().filter(|(k, _)| k % 2 == 0).collect();
64
64
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_map.retain(|k, _| k % 2 == 0)`
65
65
66
66
error: this expression can be written more simply using `.retain()`
67
- --> $DIR/manual_retain.rs:101 :5
67
+ --> $DIR/manual_retain.rs:111 :5
68
68
|
69
69
LL | hash_map = hash_map.into_iter().filter(|(_, v)| v % 2 == 0).collect();
70
70
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_map.retain(|_, &mut v| v % 2 == 0)`
71
71
72
72
error: this expression can be written more simply using `.retain()`
73
- --> $DIR/manual_retain.rs:102 :5
73
+ --> $DIR/manual_retain.rs:112 :5
74
74
|
75
75
LL | / hash_map = hash_map
76
76
LL | | .into_iter()
@@ -79,67 +79,67 @@ LL | | .collect();
79
79
| |__________________^ help: consider calling `.retain()` instead: `hash_map.retain(|k, &mut v| (k % 2 == 0) && (v % 2 == 0))`
80
80
81
81
error: this expression can be written more simply using `.retain()`
82
- --> $DIR/manual_retain.rs:123 :5
82
+ --> $DIR/manual_retain.rs:133 :5
83
83
|
84
84
LL | hash_set = hash_set.into_iter().filter(|x| x % 2 == 0).collect();
85
85
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`
86
86
87
87
error: this expression can be written more simply using `.retain()`
88
- --> $DIR/manual_retain.rs:124 :5
88
+ --> $DIR/manual_retain.rs:134 :5
89
89
|
90
90
LL | hash_set = hash_set.iter().filter(|&x| x % 2 == 0).copied().collect();
91
91
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`
92
92
93
93
error: this expression can be written more simply using `.retain()`
94
- --> $DIR/manual_retain.rs:125 :5
94
+ --> $DIR/manual_retain.rs:135 :5
95
95
|
96
96
LL | hash_set = hash_set.iter().filter(|&x| x % 2 == 0).cloned().collect();
97
97
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`
98
98
99
99
error: this expression can be written more simply using `.retain()`
100
- --> $DIR/manual_retain.rs:154 :5
100
+ --> $DIR/manual_retain.rs:164 :5
101
101
|
102
102
LL | s = s.chars().filter(|&c| c != 'o').to_owned().collect();
103
103
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `s.retain(|c| c != 'o')`
104
104
105
105
error: this expression can be written more simply using `.retain()`
106
- --> $DIR/manual_retain.rs:166 :5
106
+ --> $DIR/manual_retain.rs:176 :5
107
107
|
108
108
LL | vec = vec.iter().filter(|&x| x % 2 == 0).copied().collect();
109
109
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`
110
110
111
111
error: this expression can be written more simply using `.retain()`
112
- --> $DIR/manual_retain.rs:167 :5
112
+ --> $DIR/manual_retain.rs:177 :5
113
113
|
114
114
LL | vec = vec.iter().filter(|&x| x % 2 == 0).cloned().collect();
115
115
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`
116
116
117
117
error: this expression can be written more simply using `.retain()`
118
- --> $DIR/manual_retain.rs:168 :5
118
+ --> $DIR/manual_retain.rs:178 :5
119
119
|
120
120
LL | vec = vec.into_iter().filter(|x| x % 2 == 0).collect();
121
121
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`
122
122
123
123
error: this expression can be written more simply using `.retain()`
124
- --> $DIR/manual_retain.rs:190 :5
124
+ --> $DIR/manual_retain.rs:200 :5
125
125
|
126
126
LL | vec_deque = vec_deque.iter().filter(|&x| x % 2 == 0).copied().collect();
127
127
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`
128
128
129
129
error: this expression can be written more simply using `.retain()`
130
- --> $DIR/manual_retain.rs:191 :5
130
+ --> $DIR/manual_retain.rs:201 :5
131
131
|
132
132
LL | vec_deque = vec_deque.iter().filter(|&x| x % 2 == 0).cloned().collect();
133
133
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`
134
134
135
135
error: this expression can be written more simply using `.retain()`
136
- --> $DIR/manual_retain.rs:192 :5
136
+ --> $DIR/manual_retain.rs:202 :5
137
137
|
138
138
LL | vec_deque = vec_deque.into_iter().filter(|x| x % 2 == 0).collect();
139
139
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`
140
140
141
141
error: this expression can be written more simply using `.retain()`
142
- --> $DIR/manual_retain.rs:220 :5
142
+ --> $DIR/manual_retain.rs:230 :5
143
143
|
144
144
LL | heap = heap.into_iter().filter(|x| x % 2 == 0).collect();
145
145
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `heap.retain(|x| x % 2 == 0)`
0 commit comments