3 ms·
I actually didn't realize it was doable (not a heavy rust user - just an enthusiast). Kinda hidden away in docs under an example [0] and isn't in the book under
by bpicolo 8y ago
I actually didn't realize it was doable (not a heavy rust user - just an enthusiast). Kinda hidden away in docs under an example [0] and isn't in the book under hash maps [1]. Might be worth calling out somewhere explicitly? People getting started with rust probably aren't familiar with the trait-based operator overloading system yet.
[0] https://doc.rust-lang.org/std/collections/struct.HashMap.html#examples-16 https://doc.rust-lang.org/std/collections/struct.HashMap.htm...
[1] https://doc.rust-lang.org/book/second-edition/ch08-03-hash-maps.html https://doc.rust-lang.org/book/second-edition/ch08-03-hash-m...
- steveklabnik 8y agoYeah, might be worth it on the API docs, for sure. Maybe file a bug? :)