Uh oh!
There was an error while loading. Please reload this page.
IndexMap and IndexSet: mark remove as deprecated - #680
Merged
Conversation
zeenix
requested changes
Jul 29, 2026
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
sguedforce-pushed
the
index-map-set-remove
branch
2 times, most recently
from
July 29, 2026 11:45
dd93af5 to
9ebfe72Compare| /// **NOTE**: This is equivalent to `.swap_remove_entry()`, replacing this entry’s position | ||
| /// with the last element, and it is deprecated in favor of calling that explicitly. | ||
| #[deprecated( | ||
| note = "`remove` disrupts the map order -- use `swap_remove` for explicit behavior." |
Member
There was a problem hiding this comment.
Suggested change
| note = "`remove` disrupts the map order -- use `swap_remove` for explicit behavior." | |
| note = "`remove_entry` disrupts the map order -- use `swap_remove_entry` for explicit behavior." |
| /// let mut map = FnvIndexMap::<_, _, 8>::new(); | ||
| /// map.insert(1, "a").unwrap(); | ||
| /// assert_eq!(map.remove(&1), Some("a")); | ||
| /// assert_eq!(map.remove(&1), None); |
Member
There was a problem hiding this comment.
Examples should be moved to the non-deprecated methods.
Member
There was a problem hiding this comment.
Ah, they are already there. I'd still remove them from the deprecated methods though.
sguedforce-pushed
the
index-map-set-remove
branch
2 times, most recently
from
July 29, 2026 12:08
514654a to
e76e999Comparezeenix
requested changes
Jul 29, 2026
Uh oh!
There was an error while loading. Please reload this page.
IndexSet doesn't have any unsafe. This will help ensure any future `unsafe` is properly documented.
Remove changed the ordering of the map and this was not made clear in either the documentation or the name, this patch follows the original indexmap crate in naming it `swap_remove` instead.
zeenix
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
remove()changed the ordering of the map and this was not made clear in either the documentation or the name, this patch follows the original indexmap crate in using renaming itswap_removeinsteadCloses#679