indexmap-rs / indexmap

A hash table with consistent order and fast iteration; access items by key or sequence index
https://docs.rs/indexmap/
Other
1.67k stars 150 forks source link

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

Closed cuviper closed 5 months ago

cuviper commented 5 months ago

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 commented 5 months ago

@Morganamilo would this work for you?

Morganamilo commented 5 months ago

This is what I was looking for thanks.