summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/manual_retain.stderr
blob: 0c5b1383b6aed1a85f01d3baefda35138e3c6eaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
error: this expression can be written more simply using `.retain()`
  --> $DIR/manual_retain.rs:22:5
   |
LL |     binary_heap = binary_heap.into_iter().filter(|x| x % 2 == 0).collect();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `binary_heap.retain(|x| x % 2 == 0)`
   |
   = note: `-D clippy::manual-retain` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::manual_retain)]`

error: this expression can be written more simply using `.retain()`
  --> $DIR/manual_retain.rs:23:5
   |
LL |     binary_heap = binary_heap.iter().filter(|&x| x % 2 == 0).copied().collect();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `binary_heap.retain(|x| x % 2 == 0)`

error: this expression can be written more simply using `.retain()`
  --> $DIR/manual_retain.rs:24:5
   |
LL |     binary_heap = binary_heap.iter().filter(|&x| x % 2 == 0).cloned().collect();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `binary_heap.retain(|x| x % 2 == 0)`

error: this expression can be written more simply using `.retain()`
  --> $DIR/manual_retain.rs:54:5
   |
LL |     btree_map = btree_map.into_iter().filter(|(k, _)| k % 2 == 0).collect();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_map.retain(|k, _| k % 2 == 0)`

error: this expression can be written more simply using `.retain()`
  --> $DIR/manual_retain.rs:55:5
   |
LL |     btree_map = btree_map.into_iter().filter(|(_, v)| v % 2 == 0).collect();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_map.retain(|_, &mut v| v % 2 == 0)`

error: this expression can be written more simply using `.retain()`
  --> $DIR/manual_retain.rs:56:5
   |
LL | /     btree_map = btree_map
LL | |         .into_iter()
LL | |         .filter(|(k, v)| (k % 2 == 0) && (v % 2 == 0))
LL | |         .collect();
   | |__________________^ help: consider calling `.retain()` instead: `btree_map.retain(|k, &mut v| (k % 2 == 0) && (v % 2 == 0))`

error: this expression can be written more simply using `.retain()`
  --> $DIR/manual_retain.rs:78:5
   |
LL |     btree_set = btree_set.iter().filter(|&x| x % 2 == 0).copied().collect();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`

error: this expression can be written more simply using `.retain()`
  --> $DIR/manual_retain.rs:79:5
   |
LL |     btree_set = btree_set.iter().filter(|&x| x % 2 == 0).cloned().collect();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`

error: this expression can be written more simply using `.retain()`
  --> $DIR/manual_retain.rs:80:5
   |
LL |     btree_set = btree_set.into_iter().filter(|x| x % 2 == 0).collect();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `btree_set.retain(|x| x % 2 == 0)`

error: this expression can be written more simply using `.retain()`
  --> $DIR/manual_retain.rs:110:5
   |
LL |     hash_map = hash_map.into_iter().filter(|(k, _)| k % 2 == 0).collect();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_map.retain(|k, _| k % 2 == 0)`

error: this expression can be written more simply using `.retain()`
  --> $DIR/manual_retain.rs:111:5
   |
LL |     hash_map = hash_map.into_iter().filter(|(_, v)| v % 2 == 0).collect();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_map.retain(|_, &mut v| v % 2 == 0)`

error: this expression can be written more simply using `.retain()`
  --> $DIR/manual_retain.rs:112:5
   |
LL | /     hash_map = hash_map
LL | |         .into_iter()
LL | |         .filter(|(k, v)| (k % 2 == 0) && (v % 2 == 0))
LL | |         .collect();
   | |__________________^ help: consider calling `.retain()` instead: `hash_map.retain(|k, &mut v| (k % 2 == 0) && (v % 2 == 0))`

error: this expression can be written more simply using `.retain()`
  --> $DIR/manual_retain.rs:133:5
   |
LL |     hash_set = hash_set.into_iter().filter(|x| x % 2 == 0).collect();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`

error: this expression can be written more simply using `.retain()`
  --> $DIR/manual_retain.rs:134:5
   |
LL |     hash_set = hash_set.iter().filter(|&x| x % 2 == 0).copied().collect();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`

error: this expression can be written more simply using `.retain()`
  --> $DIR/manual_retain.rs:135:5
   |
LL |     hash_set = hash_set.iter().filter(|&x| x % 2 == 0).cloned().collect();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `hash_set.retain(|x| x % 2 == 0)`

error: this expression can be written more simply using `.retain()`
  --> $DIR/manual_retain.rs:164:5
   |
LL |     s = s.chars().filter(|&c| c != 'o').to_owned().collect();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `s.retain(|c| c != 'o')`

error: this expression can be written more simply using `.retain()`
  --> $DIR/manual_retain.rs:176:5
   |
LL |     vec = vec.iter().filter(|&x| x % 2 == 0).copied().collect();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`

error: this expression can be written more simply using `.retain()`
  --> $DIR/manual_retain.rs:177:5
   |
LL |     vec = vec.iter().filter(|&x| x % 2 == 0).cloned().collect();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`

error: this expression can be written more simply using `.retain()`
  --> $DIR/manual_retain.rs:178:5
   |
LL |     vec = vec.into_iter().filter(|x| x % 2 == 0).collect();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec.retain(|x| x % 2 == 0)`

error: this expression can be written more simply using `.retain()`
  --> $DIR/manual_retain.rs:200:5
   |
LL |     vec_deque = vec_deque.iter().filter(|&x| x % 2 == 0).copied().collect();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`

error: this expression can be written more simply using `.retain()`
  --> $DIR/manual_retain.rs:201:5
   |
LL |     vec_deque = vec_deque.iter().filter(|&x| x % 2 == 0).cloned().collect();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`

error: this expression can be written more simply using `.retain()`
  --> $DIR/manual_retain.rs:202:5
   |
LL |     vec_deque = vec_deque.into_iter().filter(|x| x % 2 == 0).collect();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `vec_deque.retain(|x| x % 2 == 0)`

error: aborting due to 22 previous errors