Closed luke-titley closed 4 years ago
Hi Luke, sorry I missed this issue earlier! There are actually dedicated HashMap and HashSet type aliases in https://github.com/anderslanglands/ustr/blob/master/src/hash.rs so that the precomputed hash can be used directly. This seemed to be the easiest way to do it. I still need to look into allowing to configure the hash function as a feature as well (which would just be selected one from the fastshash crate, or using Rust' default).
Incidentally I just pushed my latest changes which tweaks the API a little - u! macro is replaced by ustr() short function being the main one.
Ah great. I must have missed the hash.rs file.
Hey, Thanks again for writing ustr, I'm using it for all object names at the moment in a hobby project I'm working on. Seems to be working okay at the moment, but I have as yet to profile and measue the project properly before I'll be able to give any good feedback.
A quick question.
I need to use this type as a key in a HashMap. Is this how you'd recommend implementing the hash trait for it? Its a bit funny re-hashing the hash but...
Just wondering what your thoughts are on this.