Description
get_many_mut
on slices (rust-lang/rust#83608) does not need to handle a variable number of keys (although it might be nice) because, worse case scenario, you can sort your input array of indexes and iterate over it with successive split_at_mut
.
In this case however, that's not an option, as HashMap
s don't have the equivalent of split_at_mut
.
So it may be useful to be able to lookup a variable (somewhat large) number of distinct keys at the same time in a HashMap
, and get mutable references back.
That is in particular needed when we have a storage of many entries, and we want to run a round of updates on distinct subsets of keys, and want to run these in parallel.
Having get_many_mut
follow a similar model to what is described at rust-lang/rust#83608 (review) and providing an interface that allows for this would consequently be useful - in fact, that is something I currently would use.