- Suppose I do:
let v = hset.iter().collect::<Vec<_>>()
What this does is it takes a HashSet and produces a Vec<&T>
- Now, without consuming the HashSet, is it possible, via the Copy on T, to produce a Vec
let v = hset.iter().collect::<Vec<_>>()
What this does is it takes a HashSet and produces a Vec<&T>
let v = hset.iter().cloned().collect::<Vec<_>>()