-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Tracking Issue for or_insert_with_key
feature
#71024
Comments
That seems like the wrong PR |
@jonas-schievink Thank you. Corrected. Also, added a 2015 issue that requested this feature so that it can be closed if this is accepted. |
Merged into |
What does this feature need to be stabilized ? |
This is my first stabilization report, so please let me know if it's insufficient. Stabilization reportSummaryThis allows inserting key-derived values when a The difference between this and ExamplesEdge casesI cannot think of any edge cases. Stabilization pull requestThe stabilization pull request is #78083 |
Stabilize or_insert_with_key Stabilizes the `or_insert_with_key` feature from rust-lang#71024. This allows inserting key-derived values when a `HashMap`/`BTreeMap` entry is vacant. The difference between this and `.or_insert_with(|| ... )` is that this provides a reference to the key to the closure after it is moved with `.entry(key_being_moved)`, avoiding the need to copy or clone the key.
Stabilize or_insert_with_key Stabilizes the `or_insert_with_key` feature from rust-lang#71024. This allows inserting key-derived values when a `HashMap`/`BTreeMap` entry is vacant. The difference between this and `.or_insert_with(|| ... )` is that this provides a reference to the key to the closure after it is moved with `.entry(key_being_moved)`, avoiding the need to copy or clone the key.
Stabilized, this tracking issue can be closed AFAICT 🙂 |
Stabilize or_insert_with_key Stabilizes the `or_insert_with_key` feature from rust-lang/rust#71024. This allows inserting key-derived values when a `HashMap`/`BTreeMap` entry is vacant. The difference between this and `.or_insert_with(|| ... )` is that this provides a reference to the key to the closure after it is moved with `.entry(key_being_moved)`, avoiding the need to copy or clone the key.
Steps
std
(Add or_insert_with_key to Entry of HashMap/BTreeMap #70996)std
hashbrown
crate (Add or_insert_with_key to Entry of HashMap hashbrown#152)hashbrown
ChaiTRex/hashbrown
torust-lang/hashbrown
(Imported new documentation for .or_insert_with_key hashbrown#217)The text was updated successfully, but these errors were encountered: