My experience is just one data point, but in most of my code bases BTreeMap is decidedly preferable over HashMap, the issue with the latter being that it can't be reliably hashed due to the lack of ordering. So the ordering might not always be directly important, but it is quite often indirectly important.
I don't really see the issue with just adding both btree_map!
and hash_map!
. It solves the HashMap/BtreeMap ambiguity issue, it's more explicit and more descriptive, and actually gives control over which kind of map to initialize, all at a grand cost of typing 5/6 more characters relative to map!
.