Skip to content

Tracking Issue for or_insert_with_key feature #71024

Closed

Description

@ChaiTRex

Steps

Activity

  1. added
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    on Apr 11, 2020
  2. jonas-schievink commented on Apr 11, 2020

    @jonas-schievink
    Contributor
    * Implementation in `std` (#70966)
    

    That seems like the wrong PR

  3. ChaiTRex commented on Apr 11, 2020

    @ChaiTRex
    ContributorAuthor

    @jonas-schievink Thank you. Corrected.

    Also, added a 2015 issue that requested this feature so that it can be closed if this is accepted.

  4. ChaiTRex commented on Apr 12, 2020

    @ChaiTRex
    ContributorAuthor

    Merged into hashbrown (rust-lang/hashbrown#152) and into std as unstable (#70996).

  5. added
    Libs-SmallLibs issues that are considered "small" or self-contained
    I-libs-radarLibs issues that are tracked on the team's radar.
    on Jul 29, 2020
  6. a1phyr commented on Oct 17, 2020

    @a1phyr
    Contributor

    What does this feature need to be stabilized ?

  7. ChaiTRex commented on Oct 19, 2020

    @ChaiTRex
    ContributorAuthor

    This is my first stabilization report, so please let me know if it's insufficient.

    Stabilization report

    Summary

    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.

    Examples

    Edge cases

    I cannot think of any edge cases.

    Stabilization pull request

    The stabilization pull request is #78083

  8. added a commit that references this issue on Dec 19, 2020
  9. added a commit that references this issue on Dec 19, 2020
  10. jplatte commented on Dec 21, 2020

    @jplatte
    Contributor

    Stabilized, this tracking issue can be closed AFAICT 🙂

  11. ChaiTRex commented on Feb 11, 2021

    @ChaiTRex
    ContributorAuthor

    Note: Fully stabilized today in Rust 1.50 in HashMap and in BTreeMap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-collectionsArea: `std::collections`B-unstableBlocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCI-libs-radarLibs issues that are tracked on the team's radar.Libs-SmallLibs issues that are considered "small" or self-containedT-libs-api[DEPRECATED; DO NOT USE]

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions