3 ms·
You ask, rust give: https://doc.rust-lang.org/std/collections/struct.BTreeMap.html https://doc.rust-lang.org/std/collections/struct.BTreeMap.ht... I have foun
by mamcx 6y ago
You ask, rust give:
https://doc.rust-lang.org/std/collections/struct.BTreeMap.html https://doc.rust-lang.org/std/collections/struct.BTreeMap.ht...
I have found to have btree/sets included very handy.
Suddenly some hacks around hash maps fade away. For example, sort for presentation or check for min/max, dedup data, etc.. Instead of hand code, pick the proper container and COLLECT:
https://doc.rust-lang.org/std/collections/ https://doc.rust-lang.org/std/collections/
(ie: You `.collect` at the end of a iterator into your container of choice. Cool)
I think developers just adapt to whatever is provided not matter if is the real fit or not. So is important to provide a good set of types/structures.
I think all langs must give (at least):
- Int, Float, Decimal
- Bool
- Strings (unicode/utf8)
- Dates!
- Enums or better algebraic types
- Vectors, HashMap, Btree, Sets