Skip to content

Tweak and extend insert sorted by{,_key} methods #406

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

Merged
merged 4 commits into from
Aug 21, 2025

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Aug 21, 2025

  • It's generally better for closures to be the last argument, if only for cleaner formatting
  • These methods make sense on VacantEntry as well, since that already has insert_sorted
  • insert_sorted_by now takes two entries for comparison, so you don't have to capture a separate copy of the key/value that you're inserting. This is also consistent with the existing sort_by and sorted_by methods.

@cuviper cuviper force-pushed the more-insert_sorted_by branch from 5591eb1 to 354345b Compare August 21, 2025 21:22
@cuviper cuviper added this pull request to the merge queue Aug 21, 2025
Merged via the queue into indexmap-rs:main with commit 7939ae9 Aug 21, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant