-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Introduce max_by/min_by on iterators #35856
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
cc @rust-lang/libs Since these are pretty clearly following the conventions used else where like sort, I'd like to just land these immediately stable. Thoughts? |
Implementation looks good to me. I'd still prefer to land as unstable, but we could move it to FCP this cycle |
Hi, thanks for the feedback. Seems that I did not pay enough attention to the output last time, so I added two Regarding stable/unstable: Do I have to take action? Is the annotation I used correct? |
For now unstable is fine, although we'll want to open an issue on this repository rather than the rust-lang/rfcs repository and point the |
@phimuemue please update the issue number in the stability attributes to use #36105 instead of the RFC issue. |
@brson Do you think that my last commit (changing 1722 to 36015 in the comments) actually caused the build to suddenly fail? |
@phimuemue Nope. There's an unrelated issue with the travis configuration presently. @bors r+ |
📌 Commit 5928be1 has been approved by |
Introduce max_by/min_by on iterators See rust-lang/rfcs#1722 for reference. It seems that there is `min`, `max` (simple computation of min/max), `min_by_key`, `max_by_key` (min/max by comparing mapped values) but no `min_by` and `max_by` (min/max according to comparison function). However, e.g. on vectors or slices there is `sort`, `sort_by_key` and `sort_by`.
See rust-lang/rfcs#1722 for reference.
It seems that there is
min
,max
(simple computation of min/max),min_by_key
,max_by_key
(min/max by comparing mapped values) but nomin_by
andmax_by
(min/max according to comparison function). However, e.g. on vectors or slices there issort
,sort_by_key
andsort_by
.