-
Notifications
You must be signed in to change notification settings - Fork 150
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
Update readme to mention shift_remove
#220
Comments
You make a reasonable point. I'm pretty sure that line exists from before Would you care to make a pull request with changes that make sense from your view as a prospective user? |
Yes, I'm up for writing a suggested readme change for this. (can't at this moment, but I have starred the notification email for it)
By this you just mean that the index->value pairing of the later entries shifts by one, correct? If so, that seems natural given the name of the function. (it would be odd for it to be called "shift remove" if none of the entries were shifted by the operation!) |
Yeah, I meant the shift by one. Maybe that's self-explanatory, but I'm trying to imagine this from fresh eyes. :) |
Currently, the readme contains the following text:
The lines in bold keep mentioning the fact that if you call
remove
, then the preservation of the insertion-order is lost.At first, that made me disregard the library because I was looking for a HashMap implementation that is able to preserve its insertion order even after removals.
After looking at other crates, I eventually found a thread that mentioned that
indexmap
was updated to have a newshift_remove
function, which apparently does what I want.That's great! But the fact that the readme did not mention this anywhere, made me unnecessarily search around for an alternative, when all I needed to do was call
shift_remove
instead ofremove
/swap_remove
.Because of this, I request that the readme be updated to make clear mention of the fact that insertion-order can be preserved -- even after removing entries -- so long as you use the
shift_remove
function to do so.The text was updated successfully, but these errors were encountered: