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

MutableKeys for IndexSet #322

Closed Morganamilo closed 5 months ago

Morganamilo commented 5 months ago

Would it be possible to add a way to mutate keys in Set like you can Map?

cuviper commented 5 months ago

I suppose we could, but can you say more about your use-case for this?

Also, you can approximate this by using IndexMap<T, ()> with MutableKeys instead of IndexSet.

Morganamilo commented 5 months ago

I have a struct that I'm storing in a set and only hashing the name. I then want to edit some of the fields along the life of the program.