Commit edf79d0
Merge #54
54: Raw entry hasher r=Amanieu a=sujayakar
This PR allows the user to create a `HashMap` where `K` doesn't implement `Hash`, so long as they are okay with only using the raw entry API.
The first step is to move around some methods that didn't actually depend on `K: Hash`. Then, the only non-plumbing change was to defer the `.reserve(1)` call on `raw_entry_mut` to right before insertion. Then, we expose a new method `RawVacantEntryMut::insert_with_hasher` that takes in the custom hashing function and passes it in to `reserve` before inserting.
@Amanieu do these API changes merit a version bump? I think we're only allowing these methods to be used on _more_ types, but let me know.
Closes #44
Co-authored-by: Sujay Jayakar <[email protected]>1 file changed
+225
-160
lines changed
0 commit comments