-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Use internal iteration in Iterator::is_sorted_by #82198
Conversation
r? @sfackler (rust-highfive has picked a reviewer for you, use r? to override) |
} | ||
|
||
true | ||
self.all(check(&mut last, compare)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like it'd be cleaner to just use a closure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the other Iterator
's methods use separate functions like that, I guess to reduce generics bloat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, it avoids an extra implicit parameter of the actual iterator type I guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really good use case for #77960.
@bors r+ rollup |
📌 Commit 61bb183 has been approved by |
…r=sfackler Use internal iteration in Iterator::is_sorted_by
…r=sfackler Use internal iteration in Iterator::is_sorted_by
…laumeGomez Rollup of 11 pull requests Successful merges: - rust-lang#79981 (Add 'consider using' message to overflowing_literals) - rust-lang#82094 (To digit simplification) - rust-lang#82105 (Don't fail to remove files if they are missing) - rust-lang#82136 (Fix ICE: Use delay_span_bug for mismatched subst/hir arg) - rust-lang#82169 (Document that `assert!` format arguments are evaluated lazily) - rust-lang#82174 (Replace File::create and write_all with fs::write) - rust-lang#82196 (Add caveat to Path::display() about lossiness) - rust-lang#82198 (Use internal iteration in Iterator::is_sorted_by) - rust-lang#82204 (Update books) - rust-lang#82207 (rustdoc: treat edition 2021 as unstable) - rust-lang#82231 (Add long explanation for E0543) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
No description provided.