Skip to content

Conversation

itsjunetime
Copy link
Contributor

@itsjunetime itsjunetime commented Oct 4, 2025

I noticed, when working on #20777, that we were sort+deduping the same vec twice, so this just pulls that into one sort+dedup instead of two.

It does add to these fns the invariant of passing in an already-sorted list, which may not be ideal? I considered making a Deduped<'a, T>(&'a [T]) newtype to make this invariant a bit more explicit, but figured that was probably a bit overkill for these fns that are only called once.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 4, 2025
@ChayimFriedman2
Copy link
Contributor

I don't think you even need to add // Invariant, it's all in the same file and being sorted is not that important.

Thanks!

@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue Oct 4, 2025
Merged via the queue into rust-lang:master with commit 4ae99f0 Oct 4, 2025
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 4, 2025
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.

3 participants