Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add (try_)entry_ref functions and EntryRef types #331

Merged
merged 2 commits into from
Feb 14, 2025

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