3 ms·
By the way for the hashing example in count() - Rust has the Entry API for HashMaps to avoid exactly this problem: https://doc.rust-lang.org/std/collections/str
by nivenkos 6y ago
By the way for the hashing example in count() - Rust has the Entry API for HashMaps to avoid exactly this problem: https://doc.rust-lang.org/std/collections/struct.HashMap.html#method.entry https://doc.rust-lang.org/std/collections/struct.HashMap.htm...
The PartialOrd trait also uses 3-way comparisons so I think the other issue is mitigated too, but it'd be interesting to check: https://doc.rust-lang.org/std/cmp/trait.PartialOrd.html#tymethod.partial_cmp https://doc.rust-lang.org/std/cmp/trait.PartialOrd.html#tyme...