IndexMap and IndexSet: mark remove as deprecated - #680
Merged
Conversation
sgued
force-pushed
the
index-map-set-remove
branch
from
July 28, 2026 20:24
08c3b2f to
9ec9b41
Compare
zeenix
requested changes
Jul 29, 2026
sgued
force-pushed
the
index-map-set-remove
branch
2 times, most recently
from
July 29, 2026 11:45
dd93af5 to
9ebfe72
Compare
| /// **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." |
sgued
force-pushed
the
index-map-set-remove
branch
from
July 29, 2026 11:58
9ebfe72 to
e66a0b1
Compare
| /// 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.
sgued
force-pushed
the
index-map-set-remove
branch
2 times, most recently
from
July 29, 2026 12:08
514654a to
e76e999
Compare
zeenix
requested changes
Jul 29, 2026
zeenix
left a comment
Contributor
There was a problem hiding this comment.
All good otherwise IMO. 👍
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.
…p_remove()` Closes rust-embedded#679
sgued
force-pushed
the
index-map-set-remove
branch
from
July 29, 2026 15:27
e76e999 to
8a701f5
Compare
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 free
to 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