]>
Commit | Line | Data |
---|---|---|
2b03887a | 1 | error: iterating on a map's keys |
781aab86 | 2 | --> $DIR/iter_kv_map.rs:14:13 |
2b03887a FG |
3 | | |
4 | LL | let _ = map.iter().map(|(key, _)| key).collect::<Vec<_>>(); | |
5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.keys()` | |
6 | | | |
7 | = note: `-D clippy::iter-kv-map` implied by `-D warnings` | |
781aab86 | 8 | = help: to override `-D warnings` add `#[allow(clippy::iter_kv_map)]` |
2b03887a FG |
9 | |
10 | error: iterating on a map's values | |
781aab86 | 11 | --> $DIR/iter_kv_map.rs:15:13 |
2b03887a FG |
12 | | |
13 | LL | let _ = map.iter().map(|(_, value)| value).collect::<Vec<_>>(); | |
14 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values()` | |
15 | ||
16 | error: iterating on a map's values | |
781aab86 | 17 | --> $DIR/iter_kv_map.rs:16:13 |
2b03887a FG |
18 | | |
19 | LL | let _ = map.iter().map(|(_, v)| v + 2).collect::<Vec<_>>(); | |
20 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values().map(|v| v + 2)` | |
21 | ||
22 | error: iterating on a map's keys | |
781aab86 | 23 | --> $DIR/iter_kv_map.rs:18:13 |
2b03887a FG |
24 | | |
25 | LL | let _ = map.clone().into_iter().map(|(key, _)| key).collect::<Vec<_>>(); | |
26 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_keys()` | |
27 | ||
28 | error: iterating on a map's keys | |
781aab86 | 29 | --> $DIR/iter_kv_map.rs:19:13 |
2b03887a FG |
30 | | |
31 | LL | let _ = map.clone().into_iter().map(|(key, _)| key + 2).collect::<Vec<_>>(); | |
32 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_keys().map(|key| key + 2)` | |
33 | ||
34 | error: iterating on a map's values | |
781aab86 | 35 | --> $DIR/iter_kv_map.rs:21:13 |
2b03887a FG |
36 | | |
37 | LL | let _ = map.clone().into_iter().map(|(_, val)| val).collect::<Vec<_>>(); | |
38 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values()` | |
39 | ||
40 | error: iterating on a map's values | |
781aab86 | 41 | --> $DIR/iter_kv_map.rs:22:13 |
2b03887a FG |
42 | | |
43 | LL | let _ = map.clone().into_iter().map(|(_, val)| val + 2).collect::<Vec<_>>(); | |
44 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values().map(|val| val + 2)` | |
45 | ||
46 | error: iterating on a map's values | |
781aab86 | 47 | --> $DIR/iter_kv_map.rs:24:13 |
2b03887a FG |
48 | | |
49 | LL | let _ = map.clone().iter().map(|(_, val)| val).collect::<Vec<_>>(); | |
50 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().values()` | |
51 | ||
52 | error: iterating on a map's keys | |
781aab86 | 53 | --> $DIR/iter_kv_map.rs:25:13 |
2b03887a FG |
54 | | |
55 | LL | let _ = map.iter().map(|(key, _)| key).filter(|x| *x % 2 == 0).count(); | |
56 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.keys()` | |
57 | ||
58 | error: iterating on a map's keys | |
781aab86 | 59 | --> $DIR/iter_kv_map.rs:35:13 |
2b03887a FG |
60 | | |
61 | LL | let _ = map.iter().map(|(key, _value)| key * 9).count(); | |
62 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.keys().map(|key| key * 9)` | |
63 | ||
64 | error: iterating on a map's values | |
781aab86 | 65 | --> $DIR/iter_kv_map.rs:36:13 |
2b03887a FG |
66 | | |
67 | LL | let _ = map.iter().map(|(_key, value)| value * 17).count(); | |
68 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values().map(|value| value * 17)` | |
69 | ||
9c376795 | 70 | error: iterating on a map's values |
781aab86 | 71 | --> $DIR/iter_kv_map.rs:39:13 |
2b03887a | 72 | | |
9c376795 FG |
73 | LL | let _ = map.clone().into_iter().map(|(_, ref val)| ref_acceptor(val)).count(); |
74 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values().map(|ref val| ref_acceptor(val))` | |
75 | ||
76 | error: iterating on a map's values | |
781aab86 | 77 | --> $DIR/iter_kv_map.rs:42:13 |
9c376795 FG |
78 | | |
79 | LL | let _ = map | |
80 | | _____________^ | |
81 | LL | | .clone() | |
82 | LL | | .into_iter() | |
83 | LL | | .map(|(_, mut val)| { | |
84 | LL | | val += 2; | |
85 | LL | | val | |
86 | LL | | }) | |
87 | | |__________^ | |
88 | | | |
89 | help: try | |
90 | | | |
91 | LL ~ let _ = map | |
92 | LL + .clone().into_values().map(|mut val| { | |
93 | LL + val += 2; | |
94 | LL + val | |
95 | LL + }) | |
96 | | | |
97 | ||
98 | error: iterating on a map's values | |
781aab86 | 99 | --> $DIR/iter_kv_map.rs:52:13 |
9c376795 FG |
100 | | |
101 | LL | let _ = map.clone().into_iter().map(|(_, mut val)| val).count(); | |
102 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values()` | |
103 | ||
104 | error: iterating on a map's keys | |
781aab86 | 105 | --> $DIR/iter_kv_map.rs:56:13 |
9c376795 | 106 | | |
2b03887a FG |
107 | LL | let _ = map.iter().map(|(key, _)| key).collect::<Vec<_>>(); |
108 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.keys()` | |
109 | ||
110 | error: iterating on a map's values | |
781aab86 | 111 | --> $DIR/iter_kv_map.rs:57:13 |
2b03887a FG |
112 | | |
113 | LL | let _ = map.iter().map(|(_, value)| value).collect::<Vec<_>>(); | |
114 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values()` | |
115 | ||
116 | error: iterating on a map's values | |
781aab86 | 117 | --> $DIR/iter_kv_map.rs:58:13 |
2b03887a FG |
118 | | |
119 | LL | let _ = map.iter().map(|(_, v)| v + 2).collect::<Vec<_>>(); | |
120 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values().map(|v| v + 2)` | |
121 | ||
122 | error: iterating on a map's keys | |
781aab86 | 123 | --> $DIR/iter_kv_map.rs:60:13 |
2b03887a FG |
124 | | |
125 | LL | let _ = map.clone().into_iter().map(|(key, _)| key).collect::<Vec<_>>(); | |
126 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_keys()` | |
127 | ||
128 | error: iterating on a map's keys | |
781aab86 | 129 | --> $DIR/iter_kv_map.rs:61:13 |
2b03887a FG |
130 | | |
131 | LL | let _ = map.clone().into_iter().map(|(key, _)| key + 2).collect::<Vec<_>>(); | |
132 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_keys().map(|key| key + 2)` | |
133 | ||
134 | error: iterating on a map's values | |
781aab86 | 135 | --> $DIR/iter_kv_map.rs:63:13 |
2b03887a FG |
136 | | |
137 | LL | let _ = map.clone().into_iter().map(|(_, val)| val).collect::<Vec<_>>(); | |
138 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values()` | |
139 | ||
140 | error: iterating on a map's values | |
781aab86 | 141 | --> $DIR/iter_kv_map.rs:64:13 |
2b03887a FG |
142 | | |
143 | LL | let _ = map.clone().into_iter().map(|(_, val)| val + 2).collect::<Vec<_>>(); | |
144 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values().map(|val| val + 2)` | |
145 | ||
146 | error: iterating on a map's values | |
781aab86 | 147 | --> $DIR/iter_kv_map.rs:66:13 |
2b03887a FG |
148 | | |
149 | LL | let _ = map.clone().iter().map(|(_, val)| val).collect::<Vec<_>>(); | |
150 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().values()` | |
151 | ||
152 | error: iterating on a map's keys | |
781aab86 | 153 | --> $DIR/iter_kv_map.rs:67:13 |
2b03887a FG |
154 | | |
155 | LL | let _ = map.iter().map(|(key, _)| key).filter(|x| *x % 2 == 0).count(); | |
156 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.keys()` | |
157 | ||
158 | error: iterating on a map's keys | |
781aab86 | 159 | --> $DIR/iter_kv_map.rs:77:13 |
2b03887a FG |
160 | | |
161 | LL | let _ = map.iter().map(|(key, _value)| key * 9).count(); | |
162 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.keys().map(|key| key * 9)` | |
163 | ||
164 | error: iterating on a map's values | |
781aab86 | 165 | --> $DIR/iter_kv_map.rs:78:13 |
2b03887a FG |
166 | | |
167 | LL | let _ = map.iter().map(|(_key, value)| value * 17).count(); | |
168 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values().map(|value| value * 17)` | |
169 | ||
9c376795 | 170 | error: iterating on a map's values |
781aab86 | 171 | --> $DIR/iter_kv_map.rs:81:13 |
9c376795 FG |
172 | | |
173 | LL | let _ = map.clone().into_iter().map(|(_, ref val)| ref_acceptor(val)).count(); | |
174 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values().map(|ref val| ref_acceptor(val))` | |
175 | ||
176 | error: iterating on a map's values | |
781aab86 | 177 | --> $DIR/iter_kv_map.rs:84:13 |
9c376795 FG |
178 | | |
179 | LL | let _ = map | |
180 | | _____________^ | |
181 | LL | | .clone() | |
182 | LL | | .into_iter() | |
183 | LL | | .map(|(_, mut val)| { | |
184 | LL | | val += 2; | |
185 | LL | | val | |
186 | LL | | }) | |
187 | | |__________^ | |
188 | | | |
189 | help: try | |
190 | | | |
191 | LL ~ let _ = map | |
192 | LL + .clone().into_values().map(|mut val| { | |
193 | LL + val += 2; | |
194 | LL + val | |
195 | LL + }) | |
196 | | | |
197 | ||
198 | error: iterating on a map's values | |
781aab86 | 199 | --> $DIR/iter_kv_map.rs:94:13 |
9c376795 FG |
200 | | |
201 | LL | let _ = map.clone().into_iter().map(|(_, mut val)| val).count(); | |
202 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values()` | |
203 | ||
4b012472 FG |
204 | error: iterating on a map's keys |
205 | --> $DIR/iter_kv_map.rs:109:13 | |
206 | | | |
207 | LL | let _ = map.iter().map(|(key, _)| key).collect::<Vec<_>>(); | |
208 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.keys()` | |
209 | ||
210 | error: iterating on a map's values | |
211 | --> $DIR/iter_kv_map.rs:111:13 | |
212 | | | |
213 | LL | let _ = map.iter().map(|(_, value)| value).collect::<Vec<_>>(); | |
214 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values()` | |
215 | ||
216 | error: iterating on a map's values | |
217 | --> $DIR/iter_kv_map.rs:113:13 | |
218 | | | |
219 | LL | let _ = map.iter().map(|(_, v)| v + 2).collect::<Vec<_>>(); | |
220 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values().map(|v| v + 2)` | |
221 | ||
222 | error: iterating on a map's keys | |
223 | --> $DIR/iter_kv_map.rs:122:13 | |
224 | | | |
225 | LL | let _ = map.clone().into_iter().map(|(key, _)| key).collect::<Vec<_>>(); | |
226 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_keys()` | |
227 | ||
228 | error: iterating on a map's keys | |
229 | --> $DIR/iter_kv_map.rs:124:13 | |
230 | | | |
231 | LL | let _ = map.clone().into_iter().map(|(key, _)| key + 2).collect::<Vec<_>>(); | |
232 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_keys().map(|key| key + 2)` | |
233 | ||
234 | error: iterating on a map's values | |
235 | --> $DIR/iter_kv_map.rs:127:13 | |
236 | | | |
237 | LL | let _ = map.clone().into_iter().map(|(_, val)| val).collect::<Vec<_>>(); | |
238 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values()` | |
239 | ||
240 | error: iterating on a map's values | |
241 | --> $DIR/iter_kv_map.rs:129:13 | |
242 | | | |
243 | LL | let _ = map.clone().into_iter().map(|(_, val)| val + 2).collect::<Vec<_>>(); | |
244 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values().map(|val| val + 2)` | |
245 | ||
246 | error: iterating on a map's keys | |
247 | --> $DIR/iter_kv_map.rs:132:13 | |
248 | | | |
249 | LL | let _ = map.iter().map(|(key, _)| key).collect::<Vec<_>>(); | |
250 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.keys()` | |
251 | ||
252 | error: iterating on a map's values | |
253 | --> $DIR/iter_kv_map.rs:134:13 | |
254 | | | |
255 | LL | let _ = map.iter().map(|(_, value)| value).collect::<Vec<_>>(); | |
256 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values()` | |
257 | ||
258 | error: iterating on a map's values | |
259 | --> $DIR/iter_kv_map.rs:136:13 | |
260 | | | |
261 | LL | let _ = map.iter().map(|(_, v)| v + 2).collect::<Vec<_>>(); | |
262 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values().map(|v| v + 2)` | |
263 | ||
264 | error: aborting due to 38 previous errors | |
2b03887a | 265 |