Uh oh!
There was an error while loading. Please reload this page.
Stabilize or_insert_with_key - #78083
Conversation
rust-highfive
commented
Oct 18, 2020
r? @varkor (rust_highfive has picked a reviewer for you, use r? to override) |
varkor
commented
Oct 21, 2020
This will needs a libs team sign-off. r? @SimonSapin |
m-ou-se
commented
Nov 25, 2020
@rfcbot merge |
Team member @m-ou-se has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
m-ou-se
commented
Nov 25, 2020
Sorry for the delay! Unfortunately this missed 1.49. Can you update the stable versions to 1.50? |
ChaiTRex
commented
Dec 1, 2020
@m-ou-se It is updated in the latest commit. |
BurntSushi
commented
Dec 1, 2020
This seems like a useful bit of information that would be good to add to the docs. |
ChaiTRex
commented
Dec 7, 2020
@BurntSushi How about this?
|
BurntSushi
commented
Dec 8, 2020
@ChaiTRex Thank you, that looks great to me! |
rfcbot
commented
Dec 8, 2020
🔔 This is now entering its final comment period, as per the review above. 🔔 |
rfcbot
commented
Dec 18, 2020
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. The RFC will be merged soon. |
m-ou-se
commented
Dec 18, 2020
@bors r+ rollup |
bors
commented
Dec 18, 2020
📌 Commit f115be9 has been approved by |
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.
Rollup of 7 pull requests Successful merges: - rust-lang#78083 (Stabilize or_insert_with_key) - rust-lang#79211 (Add the "async" and "promise" doc aliases to `core::future::Future`) - rust-lang#79612 (Switch some links in compiler/ to intra-doc links) - rust-lang#80068 (Add `&mut` as an alias for 'reference' primitive) - rust-lang#80129 (docs: Edit rustc_ast::token::Token) - rust-lang#80133 (Suppress `CONST_ITEM_MUTATION` lint if a dereference occurs anywhere) - rust-lang#80155 (Fix typo) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Stabilizes the
or_insert_with_keyfeature from #71024. This allows inserting key-derived values when aHashMap/BTreeMapentry 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.