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

Feature request: try_insert method #182

Open
mb64 opened this issue Mar 18, 2021 · 1 comment
Open

Feature request: try_insert method #182

mb64 opened this issue Mar 18, 2021 · 1 comment
Labels
waiting-for-std Changes waiting for stabilization in the standard library, so we can match the API.

Comments

@mb64
Copy link

mb64 commented Mar 18, 2021

The standard library hashmap and btree map recently got a nightly-only try_insert operation (here's the tracking issue), which makes it very convenient to insert something into a map, panicking in the case that it's already there:

the_map.try_insert(key, value).unwrap();

It would be nice to also have this for IndexMap.

@cuviper
Copy link
Member

cuviper commented Mar 18, 2021

We're happy to match such methods once they're stable, but until then it's subject to change, and we don't want indexmap to get stuck with differences.

@cuviper cuviper added the waiting-for-std Changes waiting for stabilization in the standard library, so we can match the API. label Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-for-std Changes waiting for stabilization in the standard library, so we can match the API.
Projects
None yet
Development

No branches or pull requests

2 participants