im-rs
im-rs copied to clipboard
OrdMap and iter_mut
OrdMap
doesn't seem to have iter_mut
like HashMap
. Is there a design reason for this or is this just something that hasn't been implemented yet?
I wanted the same and came here, ready to do a PR, but after the borrow checker reminded me that just copy-pasting immutable code doesn't actually make for valid mutable code…
I'm pretty sure this could be implemented using something akin to the recursive_reference
crate, but seeing the metadata I can find on it I'm far from sure it would be a dependency that could be accepted upstream (it seems to eg. have very few downloads for now, and it's definitely dealing with unsafe code so correctness is important). I'm willing to try making it into a PR, but would like some confirmation that it would have a chance of getting in first? :)
I would also love to see iter_mut
for OrdMap
. In the meanwhile, what would be a reasonable workaround? I'm guessing a combination of iter
+ get_mut
?