Skip to content

Make slice::is_sorted_by implementation nicer #109273

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Mar 20, 2023

Conversation

WaffleLapkin
Copy link
Member

Just tweak implementation a little :)

r? @thomcc

This makes a bit more sense — iter impl converts to slice first, while
slice impl used to create iter, doing unnecessary conversions.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 17, 2023
@rustbot

This comment was marked as resolved.

@WaffleLapkin WaffleLapkin changed the title Slice is sorted by array windows Make slice::is_sorted_by implementation nicer Mar 17, 2023
@scottmcm
Copy link
Member

Sure, makes sense to me. I like taking advantage of array_windows, and implementing the iterator in terms of the inherent is a more normal direction.
r? @scottmcm
@bors r+

@bors
Copy link
Collaborator

bors commented Mar 18, 2023

📌 Commit c2ccdfa has been approved by scottmcm

It is now in the queue for this repository.

@rustbot rustbot assigned scottmcm and unassigned thomcc Mar 18, 2023
@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 18, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 20, 2023
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#109170 (Set `CMAKE_SYSTEM_NAME` for Linux targets)
 - rust-lang#109266 (rustdoc: Correctly merge import's and its target's docs in one more case)
 - rust-lang#109267 (Add tests for configure.py)
 - rust-lang#109273 (Make `slice::is_sorted_by` implementation nicer)
 - rust-lang#109277 (Fix generics_of for impl's RPITIT synthesized associated type)
 - rust-lang#109307 (Ignore `Inlined` spans when computing caller location.)
 - rust-lang#109364 (Only expect a GAT const param for `type_of` of GAT const arg)
 - rust-lang#109365 (Update mdbook)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 88caa29 into rust-lang:master Mar 20, 2023
@rustbot rustbot added this to the 1.70.0 milestone Mar 20, 2023
@WaffleLapkin WaffleLapkin deleted the slice_is_sorted_by_array_windows branch June 1, 2025 13:25
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants