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