News for hackers. Stuff that matters.
Re:50 Algorithms Every Programmer Should Know (Second Edition) by alpaca128 on Wednesday January 03, 2024 @08:10AM (#38853627)
Rust's HashSet is a HashMap mapping to "()", which is Rust's equivalent to "void".
Re:50 Algorithms Every Programmer Should Know (Second Edition) by progbits on Wednesday January 03, 2024 @10:19AM (#38855064)
That is true for the internal implementation details but HashSet provides a different API, it is not just a type alias. So you don't have to worry about semantics of what the values mean (like the bools in Go), and it has no size overhead.