-
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
Add then
and then_with
for ordering.
#37054
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. |
@@ -245,6 +245,76 @@ impl Ordering { | |||
Greater => Less, | |||
} | |||
} | |||
|
|||
/// Chain two orderings. |
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.
s/Chain/Chains/
} | ||
} | ||
|
||
/// Chain the ordering with given function. |
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.
Chains the ordering with the given function.
Fixed doctests, can you please take another look? Should I rename this as discussed in the rust-lang/rfcs#1677 ? |
@rfcbot fcp merge Seems like a nifty API to me! |
Team member @alexcrichton has proposed to merge this. The next step is review by the rest of the tagged teams: Concerns:
Once these reviewers reach consensus, this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
@rfcbot concern Naming This looks like handy functionality, but I think we should consider the naming a bit. I imagine the proposed name is based on analogy with methods on e.g. My basic fear is that, when reading code, Unfortunately, nothing better is leaping to mind. Anybody else share this concern, or have alternative ideas? |
Hm yeah that is true. In retrospect if I initially saw something like Other thoughts brought up in rust-lang/rfcs#1677 were I sort of like the name |
I've used the name |
@rednum |
@rfcbot resolved Naming |
☔ The latest upstream changes (presumably #37299) made this pull request unmergeable. Please resolve the merge conflicts. |
Conflicts: src/libcoretest/lib.rs
I think the names without precedent are unfortunate, but can't think of anything better. |
🔔 This is now entering its final comment period, as per the review above. 🔔 psst @alexcrichton, I wasn't able to add the |
@bors: r+ |
📌 Commit 655effe has been approved by |
Add or and or_else for ordering. Fixes #37053 (see discussion in rust-lang/rfcs#1677).
then
and then_with
for ordering.
Fixes #37053 (see discussion in rust-lang/rfcs#1677).