How can I use some sort of set(unorder collection of strings) as the keys for a HashMap?
I'm trying to port PBC/HowCanYouPayMana.v3.py at master · DrAlta/PBC · GitHub
How can I use some sort of set(unorder collection of strings) as the keys for a HashMap?
I'm trying to port PBC/HowCanYouPayMana.v3.py at master · DrAlta/PBC · GitHub
BTreeSet
implements Hash
and can be used as the key in a HashMap
.
Kind of ironic that HashSet
doesn't have an impl for Hash
.
Since the HashSet
doesn't have defined ordering of its element, it cannot generates consistent hash over different HashSet
s with same elements.
It was once attempted:
https://github.com/rust-lang/rust/pull/48366
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.