Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

In Rust thanks to it you can have BTreeSet of BTreeSet-s.


I think my comment was way too short.

What I meant was that I needed a set type in Rust. At first I tried to use HashSet but I needed it's elements to also be sets. I couldn't because HashSet doesn't itself have a natural Hash. I'd need to implement it myself.

However while using BTreeSet the requirement on the elements is that they have natural ordering (have Ord trait) but the BTreeSet itself also implements Ord so I could have a BTreeSet of BTreeSets without implementing anything additionally. Thanks to the fact that BTrees have natural ordering.

So I used BTreeSet instead,




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: