fn main() {
let c: std::collections::HashMap<i32, String> = Default::default();
for (_, b) in c {
println!("{:?}", b);
}
}
The lint suggests to use values() but AFAIK there is no consuming alternative to values(). (And if it exists, the message should mention it.)
Similar issue: #709.
Imo this is correct for copy types.
Imo this is correct for copy types.
indeed it may be. I've changed value type to String in the example, just to make it more clear.
The example in the OP works now without triggering a clippy attack. Seems like this has been fixed.
If it is fixed, it would be nice to add this example to tests/ui/for_kv_map.rs as well.
I'll raise a PR when I have a spare moment.
Most helpful comment
I'll raise a PR when I have a spare moment.