I am not having much luck with finding a clean way to search for an unused key in a HashMap.
To clarify with an example, if I have a
HashMap<u8, _>, then there are 256 possible keys from 0 through to 255. I would like to write a function that outputs
Some(u8) if there is an available key and
None otherwise, i.e.:
fn find_unused_key(map: &HashMap<u8, _>) -> Option<u8>
How would one do this?