1
1
error: this expression can be written more simply using `.retain()`
2
- --> $DIR/use_retain .rs:52:5
2
+ --> $DIR/manual_retain .rs:52: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
- = note: `-D clippy::use -retain` implied by `-D warnings`
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/use_retain .rs:53:5
10
+ --> $DIR/manual_retain .rs:53: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:54:5
16
+ --> $DIR/manual_retain .rs:54:5
17
17
|
18
18
LL | / btree_map = btree_map
19
19
LL | | .into_iter()
@@ -22,37 +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:76:5
25
+ --> $DIR/manual_retain .rs:76: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:77:5
31
+ --> $DIR/manual_retain .rs:77:5
32
32
|
33
33
LL | btree_set = btree_set.iter().filter(|&x| x % 2 == 0).cloned().collect();
34
34
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`
35
35
36
36
error: this expression can be written more simply using `.retain()`
37
- --> $DIR/use_retain .rs:78:5
37
+ --> $DIR/manual_retain .rs:78:5
38
38
|
39
39
LL | btree_set = btree_set.into_iter().filter(|x| x % 2 == 0).collect();
40
40
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`
41
41
42
42
error: this expression can be written more simply using `.retain()`
43
- --> $DIR/use_retain .rs:108:5
43
+ --> $DIR/manual_retain .rs:108:5
44
44
|
45
45
LL | hash_map = hash_map.into_iter().filter(|(k, _)| k % 2 == 0).collect();
46
46
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_map.retain(|k, _| k % 2 == 0)`
47
47
48
48
error: this expression can be written more simply using `.retain()`
49
- --> $DIR/use_retain .rs:109:5
49
+ --> $DIR/manual_retain .rs:109:5
50
50
|
51
51
LL | hash_map = hash_map.into_iter().filter(|(_, v)| v % 2 == 0).collect();
52
52
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_map.retain(|_, &mut v| v % 2 == 0)`
53
53
54
54
error: this expression can be written more simply using `.retain()`
55
- --> $DIR/use_retain .rs:110:5
55
+ --> $DIR/manual_retain .rs:110:5
56
56
|
57
57
LL | / hash_map = hash_map
58
58
LL | | .into_iter()
@@ -61,61 +61,61 @@ LL | | .collect();
61
61
| |__________________^ help: consider calling `.retain()` instead: `hash_map.retain(|k, &mut v| (k % 2 == 0) && (v % 2 == 0))`
62
62
63
63
error: this expression can be written more simply using `.retain()`
64
- --> $DIR/use_retain .rs:131:5
64
+ --> $DIR/manual_retain .rs:131:5
65
65
|
66
66
LL | hash_set = hash_set.into_iter().filter(|x| x % 2 == 0).collect();
67
67
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`
68
68
69
69
error: this expression can be written more simply using `.retain()`
70
- --> $DIR/use_retain .rs:132:5
70
+ --> $DIR/manual_retain .rs:132:5
71
71
|
72
72
LL | hash_set = hash_set.iter().filter(|&x| x % 2 == 0).copied().collect();
73
73
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`
74
74
75
75
error: this expression can be written more simply using `.retain()`
76
- --> $DIR/use_retain .rs:133:5
76
+ --> $DIR/manual_retain .rs:133:5
77
77
|
78
78
LL | hash_set = hash_set.iter().filter(|&x| x % 2 == 0).cloned().collect();
79
79
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`
80
80
81
81
error: this expression can be written more simply using `.retain()`
82
- --> $DIR/use_retain .rs:162:5
82
+ --> $DIR/manual_retain .rs:162:5
83
83
|
84
84
LL | s = s.chars().filter(|&c| c != 'o').to_owned().collect();
85
85
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `s.retain(|c| c != 'o')`
86
86
87
87
error: this expression can be written more simply using `.retain()`
88
- --> $DIR/use_retain .rs:174:5
88
+ --> $DIR/manual_retain .rs:174:5
89
89
|
90
90
LL | vec = vec.iter().filter(|&x| x % 2 == 0).copied().collect();
91
91
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`
92
92
93
93
error: this expression can be written more simply using `.retain()`
94
- --> $DIR/use_retain .rs:175:5
94
+ --> $DIR/manual_retain .rs:175:5
95
95
|
96
96
LL | vec = vec.iter().filter(|&x| x % 2 == 0).cloned().collect();
97
97
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`
98
98
99
99
error: this expression can be written more simply using `.retain()`
100
- --> $DIR/use_retain .rs:176:5
100
+ --> $DIR/manual_retain .rs:176:5
101
101
|
102
102
LL | vec = vec.into_iter().filter(|x| x % 2 == 0).collect();
103
103
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`
104
104
105
105
error: this expression can be written more simply using `.retain()`
106
- --> $DIR/use_retain .rs:198:5
106
+ --> $DIR/manual_retain .rs:198:5
107
107
|
108
108
LL | vec_deque = vec_deque.iter().filter(|&x| x % 2 == 0).copied().collect();
109
109
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`
110
110
111
111
error: this expression can be written more simply using `.retain()`
112
- --> $DIR/use_retain .rs:199:5
112
+ --> $DIR/manual_retain .rs:199:5
113
113
|
114
114
LL | vec_deque = vec_deque.iter().filter(|&x| x % 2 == 0).cloned().collect();
115
115
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`
116
116
117
117
error: this expression can be written more simply using `.retain()`
118
- --> $DIR/use_retain .rs:200:5
118
+ --> $DIR/manual_retain .rs:200:5
119
119
|
120
120
LL | vec_deque = vec_deque.into_iter().filter(|x| x % 2 == 0).collect();
121
121
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`
0 commit comments