Skip to content
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

Merged
merged 3 commits into from
Sep 3, 2016
Merged

Conversation

phimuemue
Copy link
Contributor

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.

@rust-highfive
Copy link
Collaborator

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.

@sfackler
Copy link
Member

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?

@alexcrichton
Copy link
Member

Implementation looks good to me. I'd still prefer to land as unstable, but we could move it to FCP this cycle

@phimuemue
Copy link
Contributor Author

Hi, thanks for the feedback. Seems that I did not pay enough attention to the output last time, so I added two #![feature] declarations and ran make check, which outputted 11137 passed; 0 failed; 117 ignored; 0 measured.

Regarding stable/unstable: Do I have to take action? Is the annotation I used correct?

@alexcrichton
Copy link
Member

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 issue number to that, but we can do that just before landing as well.

@brson
Copy link
Contributor

brson commented Aug 29, 2016

@phimuemue please update the issue number in the stability attributes to use #36105 instead of the RFC issue.

@phimuemue
Copy link
Contributor Author

@brson Do you think that my last commit (changing 1722 to 36015 in the comments) actually caused the build to suddenly fail?

@brson
Copy link
Contributor

brson commented Sep 2, 2016

@phimuemue Nope. There's an unrelated issue with the travis configuration presently.

@bors r+

@bors
Copy link
Contributor

bors commented Sep 2, 2016

📌 Commit 5928be1 has been approved by brson

@bors
Copy link
Contributor

bors commented Sep 3, 2016

⌛ Testing commit 5928be1 with merge d128e6b...

bors added a commit that referenced this pull request Sep 3, 2016
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`.
@bors bors merged commit 5928be1 into rust-lang:master Sep 3, 2016
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.

6 participants