the.bay.news

Iterator of mutable references over a hashmap

The Rust Programming Language Forum
Iterator of mutable references over a hashmap
Hi, I have a HashMap<usize, Foo> that I want to iterate over in an arbitrary order that is set independently from the HashMap internal state. For context, this is for modelling, so I need the iteration order to be reproducible (for testing) and to be able to shuffle it with an Rng to avoid order effects when iterating over my Foos. I therefore cannot just use HashMap::values() and HashMap::values_mut() whose iteration order is not guaranteed nor can be shuffled. For convenience, I was hoping t...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.