]> git.lizzy.rs Git - rust.git/blob - tests/ui/iter_kv_map.stderr
Add iter_kv_map lint
[rust.git] / tests / ui / iter_kv_map.stderr
1 error: iterating on a map's keys
2   --> $DIR/iter_kv_map.rs:14:13
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`
8
9 error: iterating on a map's values
10   --> $DIR/iter_kv_map.rs:15:13
11    |
12 LL |     let _ = map.iter().map(|(_, value)| value).collect::<Vec<_>>();
13    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values()`
14
15 error: iterating on a map's values
16   --> $DIR/iter_kv_map.rs:16:13
17    |
18 LL |     let _ = map.iter().map(|(_, v)| v + 2).collect::<Vec<_>>();
19    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values().map(|v| v + 2)`
20
21 error: iterating on a map's values
22   --> $DIR/iter_kv_map.rs:17:13
23    |
24 LL |     let _ = map.iter().map(|(_, val)| {val}).collect::<Vec<_>>();
25    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values().map(|val| {val})`
26
27 error: iterating on a map's keys
28   --> $DIR/iter_kv_map.rs:19:13
29    |
30 LL |     let _ = map.clone().into_iter().map(|(key, _)| key).collect::<Vec<_>>();
31    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_keys()`
32
33 error: iterating on a map's keys
34   --> $DIR/iter_kv_map.rs:20:13
35    |
36 LL |     let _ = map.clone().into_iter().map(|(key, _)| key + 2).collect::<Vec<_>>();
37    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_keys().map(|key| key + 2)`
38
39 error: iterating on a map's values
40   --> $DIR/iter_kv_map.rs:22:13
41    |
42 LL |     let _ = map.clone().into_iter().map(|(_, val)| val).collect::<Vec<_>>();
43    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values()`
44
45 error: iterating on a map's values
46   --> $DIR/iter_kv_map.rs:23:13
47    |
48 LL |     let _ = map.clone().into_iter().map(|(_, val)| val + 2).collect::<Vec<_>>();
49    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values().map(|val| val + 2)`
50
51 error: iterating on a map's values
52   --> $DIR/iter_kv_map.rs:25:13
53    |
54 LL |     let _ = map.clone().iter().map(|(_, val)| val).collect::<Vec<_>>();
55    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().values()`
56
57 error: iterating on a map's keys
58   --> $DIR/iter_kv_map.rs:26:5
59    |
60 LL |     map.iter().map(|(key, _)| key).filter(|x| *x % 2 == 0).count();
61    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.keys()`
62
63 error: iterating on a map's keys
64   --> $DIR/iter_kv_map.rs:36:5
65    |
66 LL |     map.iter().map(|(key, _value)| key * 9).count();
67    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.keys().map(|key| key * 9)`
68
69 error: iterating on a map's values
70   --> $DIR/iter_kv_map.rs:37:5
71    |
72 LL |     map.iter().map(|(_key, value)| value * 17).count();
73    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values().map(|value| value * 17)`
74
75 error: iterating on a map's keys
76   --> $DIR/iter_kv_map.rs:41:13
77    |
78 LL |     let _ = map.iter().map(|(key, _)| key).collect::<Vec<_>>();
79    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.keys()`
80
81 error: iterating on a map's values
82   --> $DIR/iter_kv_map.rs:42:13
83    |
84 LL |     let _ = map.iter().map(|(_, value)| value).collect::<Vec<_>>();
85    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values()`
86
87 error: iterating on a map's values
88   --> $DIR/iter_kv_map.rs:43:13
89    |
90 LL |     let _ = map.iter().map(|(_, v)| v + 2).collect::<Vec<_>>();
91    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values().map(|v| v + 2)`
92
93 error: iterating on a map's values
94   --> $DIR/iter_kv_map.rs:44:13
95    |
96 LL |     let _ = map.iter().map(|(_, val)| {val}).collect::<Vec<_>>();
97    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values().map(|val| {val})`
98
99 error: iterating on a map's keys
100   --> $DIR/iter_kv_map.rs:46:13
101    |
102 LL |     let _ = map.clone().into_iter().map(|(key, _)| key).collect::<Vec<_>>();
103    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_keys()`
104
105 error: iterating on a map's keys
106   --> $DIR/iter_kv_map.rs:47:13
107    |
108 LL |     let _ = map.clone().into_iter().map(|(key, _)| key + 2).collect::<Vec<_>>();
109    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_keys().map(|key| key + 2)`
110
111 error: iterating on a map's values
112   --> $DIR/iter_kv_map.rs:49:13
113    |
114 LL |     let _ = map.clone().into_iter().map(|(_, val)| val).collect::<Vec<_>>();
115    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values()`
116
117 error: iterating on a map's values
118   --> $DIR/iter_kv_map.rs:50:13
119    |
120 LL |     let _ = map.clone().into_iter().map(|(_, val)| val + 2).collect::<Vec<_>>();
121    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values().map(|val| val + 2)`
122
123 error: iterating on a map's values
124   --> $DIR/iter_kv_map.rs:52:13
125    |
126 LL |     let _ = map.clone().iter().map(|(_, val)| val).collect::<Vec<_>>();
127    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().values()`
128
129 error: iterating on a map's keys
130   --> $DIR/iter_kv_map.rs:53:5
131    |
132 LL |     map.iter().map(|(key, _)| key).filter(|x| *x % 2 == 0).count();
133    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.keys()`
134
135 error: iterating on a map's keys
136   --> $DIR/iter_kv_map.rs:63:5
137    |
138 LL |     map.iter().map(|(key, _value)| key * 9).count();
139    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.keys().map(|key| key * 9)`
140
141 error: iterating on a map's values
142   --> $DIR/iter_kv_map.rs:64:5
143    |
144 LL |     map.iter().map(|(_key, value)| value * 17).count();
145    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values().map(|value| value * 17)`
146
147 error: aborting due to 24 previous errors
148