1
1
error: this expression can be written more simply using `.retain()`
2
- --> $DIR/use_retain.rs:45 :5
2
+ --> $DIR/use_retain.rs:47 :5
3
3
|
4
4
LL | btree_map = btree_map.into_iter().filter(|(k, _)| k % 2 == 0).collect();
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_map.retain(|k, _| k % 2 == 0)`
6
6
|
7
7
= note: `-D clippy::use-retain` implied by `-D warnings`
8
8
9
9
error: this expression can be written more simply using `.retain()`
10
- --> $DIR/use_retain.rs:46 :5
10
+ --> $DIR/use_retain.rs:48 :5
11
11
|
12
12
LL | btree_map = btree_map.into_iter().filter(|(_, v)| v % 2 == 0).collect();
13
13
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_map.retain(|_, &mut v| v % 2 == 0)`
14
14
15
15
error: this expression can be written more simply using `.retain()`
16
- --> $DIR/use_retain.rs:47 :5
16
+ --> $DIR/use_retain.rs:49 :5
17
17
|
18
18
LL | / btree_map = btree_map
19
19
LL | | .into_iter()
@@ -22,31 +22,37 @@ LL | | .collect();
22
22
| |__________________^ help: consider calling `.retain()` instead: `btree_map.retain(|k, &mut v| (k % 2 == 0) && (v % 2 == 0))`
23
23
24
24
error: this expression can be written more simply using `.retain()`
25
- --> $DIR/use_retain.rs:69 :5
25
+ --> $DIR/use_retain.rs:71 :5
26
26
|
27
27
LL | btree_set = btree_set.iter().filter(|&x| x % 2 == 0).copied().collect();
28
28
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`
29
29
30
30
error: this expression can be written more simply using `.retain()`
31
- --> $DIR/use_retain.rs:70:5
31
+ --> $DIR/use_retain.rs:72:5
32
+ |
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)`
35
+
36
+ error: this expression can be written more simply using `.retain()`
37
+ --> $DIR/use_retain.rs:73:5
32
38
|
33
39
LL | btree_set = btree_set.into_iter().filter(|x| x % 2 == 0).collect();
34
40
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`
35
41
36
42
error: this expression can be written more simply using `.retain()`
37
- --> $DIR/use_retain.rs:93 :5
43
+ --> $DIR/use_retain.rs:103 :5
38
44
|
39
45
LL | hash_map = hash_map.into_iter().filter(|(k, _)| k % 2 == 0).collect();
40
46
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_map.retain(|k, _| k % 2 == 0)`
41
47
42
48
error: this expression can be written more simply using `.retain()`
43
- --> $DIR/use_retain.rs:94 :5
49
+ --> $DIR/use_retain.rs:104 :5
44
50
|
45
51
LL | hash_map = hash_map.into_iter().filter(|(_, v)| v % 2 == 0).collect();
46
52
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_map.retain(|_, &mut v| v % 2 == 0)`
47
53
48
54
error: this expression can be written more simply using `.retain()`
49
- --> $DIR/use_retain.rs:95 :5
55
+ --> $DIR/use_retain.rs:105 :5
50
56
|
51
57
LL | / hash_map = hash_map
52
58
LL | | .into_iter()
@@ -55,46 +61,64 @@ LL | | .collect();
55
61
| |__________________^ help: consider calling `.retain()` instead: `hash_map.retain(|k, &mut v| (k % 2 == 0) && (v % 2 == 0))`
56
62
57
63
error: this expression can be written more simply using `.retain()`
58
- --> $DIR/use_retain.rs:116 :5
64
+ --> $DIR/use_retain.rs:126 :5
59
65
|
60
66
LL | hash_set = hash_set.into_iter().filter(|x| x % 2 == 0).collect();
61
67
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`
62
68
63
69
error: this expression can be written more simply using `.retain()`
64
- --> $DIR/use_retain.rs:117 :5
70
+ --> $DIR/use_retain.rs:127 :5
65
71
|
66
72
LL | hash_set = hash_set.iter().filter(|&x| x % 2 == 0).copied().collect();
67
73
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`
68
74
69
75
error: this expression can be written more simply using `.retain()`
70
- --> $DIR/use_retain.rs:139:5
76
+ --> $DIR/use_retain.rs:128:5
77
+ |
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)`
80
+
81
+ error: this expression can be written more simply using `.retain()`
82
+ --> $DIR/use_retain.rs:157:5
71
83
|
72
84
LL | s = s.chars().filter(|&c| c != 'o').to_owned().collect();
73
85
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `s.retain(|c| c != 'o')`
74
86
75
87
error: this expression can be written more simply using `.retain()`
76
- --> $DIR/use_retain.rs:151 :5
88
+ --> $DIR/use_retain.rs:169 :5
77
89
|
78
90
LL | vec = vec.iter().filter(|&x| x % 2 == 0).copied().collect();
79
91
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`
80
92
81
93
error: this expression can be written more simply using `.retain()`
82
- --> $DIR/use_retain.rs:152:5
94
+ --> $DIR/use_retain.rs:170:5
95
+ |
96
+ LL | vec = vec.iter().filter(|&x| x % 2 == 0).cloned().collect();
97
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`
98
+
99
+ error: this expression can be written more simply using `.retain()`
100
+ --> $DIR/use_retain.rs:171:5
83
101
|
84
102
LL | vec = vec.into_iter().filter(|x| x % 2 == 0).collect();
85
103
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`
86
104
87
105
error: this expression can be written more simply using `.retain()`
88
- --> $DIR/use_retain.rs:172 :5
106
+ --> $DIR/use_retain.rs:193 :5
89
107
|
90
108
LL | vec_deque = vec_deque.iter().filter(|&x| x % 2 == 0).copied().collect();
91
109
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`
92
110
93
111
error: this expression can be written more simply using `.retain()`
94
- --> $DIR/use_retain.rs:173:5
112
+ --> $DIR/use_retain.rs:194:5
113
+ |
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)`
116
+
117
+ error: this expression can be written more simply using `.retain()`
118
+ --> $DIR/use_retain.rs:195:5
95
119
|
96
120
LL | vec_deque = vec_deque.into_iter().filter(|x| x % 2 == 0).collect();
97
121
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`
98
122
99
- error: aborting due to 15 previous errors
123
+ error: aborting due to 19 previous errors
100
124
0 commit comments