I thought that it might be a good idea to add an
expect method for the entry API. Currently one can do this
let map: HashMap<i32, i32> = HashMap::new(); let entry = map.entry(7).or_insert_with(|| panic!());
or_insert_with is just not great for the readability, IMHO.
The other problem with the Entry API usability is that it consumes the key. Is there any reason why it’s not taken by reference?