I have a hashmap: HashMap<SomeKey, SomeValue>
and I want to consume the hashmap
and get all its values as a vector.
The way I do it right now is
let v: Vec<SomeValue> = hashmap.values().cloned().collect();
cloned
copies each value, but this construction doesn't consume the hashmap. I am OK with consuming the map.
Is there some way to get values without copying them?