Skip to content

Comments

Add (try_)entry_ref functions and EntryRef types#331

Merged
xacrimon merged 2 commits intoxacrimon:masterfrom
tfreiberg-fastly:tfreiberg/entry-ref
Feb 14, 2025
Merged

Add (try_)entry_ref functions and EntryRef types#331
xacrimon merged 2 commits intoxacrimon:masterfrom
tfreiberg-fastly:tfreiberg/entry-ref

Conversation

@tfreiberg-fastly
Copy link
Contributor

@tfreiberg-fastly tfreiberg-fastly commented Feb 14, 2025

As discussed in #183

Adds an EntryRef API similar to https://docs.rs/hashbrown/latest/hashbrown/hash_map/enum.EntryRef.html

The main difference is that I also added an OccupiedEntryRef type which can return the borrowed &Q key in the key() function and it means that VacantEntryRef::insert_entry doesn't have to convert from &Q to K twice

BTW, nice job moving to the detached guards, that made this very easy!

@xacrimon
Copy link
Owner

lgtm

@xacrimon xacrimon merged commit 0198c59 into xacrimon:master Feb 14, 2025
6 checks passed
@xacrimon
Copy link
Owner

xacrimon commented Feb 14, 2025

@tfreiberg-fastly Probably a month or so out from a stable v7 release but you can use this funtionality today by pinning version 7.0.0-rc1 from crates.io.

@tfreiberg-fastly tfreiberg-fastly deleted the tfreiberg/entry-ref branch March 5, 2025 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants