Skip to content

LinearMap entry API #471

Open
Open
@Ten0

Description

@Ten0

Currently to insert in the LinearMap and get a mutable reference to the corresponding value (map.entry(key).or_insert_with(...)), it's necessary to .insert() then .get().unwrap(), because there is no entry API or assimilated.

This implies:

  • Cloning the key, in order to be able to call get()
  • Iterating on the map twice: once to realize the entry is not there, and once to get the inserted entry

There was already an issue for entry APIs for maps: #103, but that was closed after only implementing it for only one of the map types: #289 - I would tend to believe that this was not intentional.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions