Skip to content

Commit

Permalink
Auto merge of #301 - ajtribick:entry_ref, r=Amanieu
Browse files Browse the repository at this point in the history
Add entry_ref API to HashMap

An initial attempt at an `entry_ref` API to do the simple case that `raw_entry_mut` is used for. I basically attempted to mirror the existing `entry` API, but allow passing a borrowed version of the key. I left off mirroring the `Send` and `Sync` traits as I'm not sure what these should be.

The relationships I use between the key `K` and borrowed key `Q` is `K: Borrow<Q> + From<&Q>`. The reason for not using `Q: ToOwned<K>` is to support key types like `Rc<str>` (which is used in a couple of the doctests), which would not be possible with `to_owned()`.

Hopefully this is somewhat useful.
  • Loading branch information
bors committed Dec 19, 2021
2 parents b3eaf32 + 7c545e1 commit 898a9fe
Show file tree
Hide file tree
Showing 2 changed files with 1,171 additions and 67 deletions.
Loading

0 comments on commit 898a9fe

Please sign in to comment.