Skip to content

Opt-in mutable access on IndexSet, release 2.2.6#323

Merged
cuviper merged 4 commits intoindexmap-rs:masterfrom
cuviper:mutable
Mar 23, 2024
Merged

Opt-in mutable access on IndexSet, release 2.2.6#323
cuviper merged 4 commits intoindexmap-rs:masterfrom
cuviper:mutable

Conversation

@cuviper
Copy link
Member

@cuviper cuviper commented Mar 20, 2024

This adds set::MutableValues as an opt-in trait for accessing IndexSet values by mutable reference, akin to map::MutableKeys. The implementation simply forwards to the map implementation while discarding the () inner "value".

Unlike IndexMap, IndexSet doesn't have regular get_full_mut or get_index_mut methods, so the "2" suffix here isn't really necessary, but I thought it might be better to stay consistent with MutableKeys on that.

Closes #322

@cuviper
Copy link
Member Author

cuviper commented Mar 20, 2024

@Morganamilo would this work for you?

@Morganamilo
Copy link

This is what I was looking for thanks.

@cuviper cuviper changed the title Opt-in mutable access on IndexSet Opt-in mutable access on IndexSet, release 2.2.6 Mar 22, 2024
@cuviper cuviper added this pull request to the merge queue Mar 23, 2024
Merged via the queue into indexmap-rs:master with commit 3f0fffb Mar 23, 2024
@cuviper cuviper deleted the mutable branch August 30, 2024 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MutableKeys for IndexSet

2 participants