-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Ordering::and_then #34774
Comments
Seems like a weird name for such a function IMO. Also, I believe, this should go into the RFC repo. |
@nagisa Java has a similar function for comparators, called
as "compare by name, then by address". The I don't know about the RFC thing, I usually see library functions posted here. Plus, I'm not confident I can handle the politics of RFC -> feature -> stabilization, so I am hoping someone more prominent thinks this is a good idea and picks up the baton. |
You don’t need a full RFC, only this issue should be in that repository, since this issue (as well as many other feature requests) are RFCs in their most primitive form.
When you put it like this it seems to make sense, but I feel like there still may be better ways to call it, especially for |
This seems like an obvious and missing function from
std::cmp::Ordering
:This is useful for creating comparators which do lexicographic order. The second variant allows for skipping the order calculation if it is not necessary. Names are of course open to bikeshedding.
The text was updated successfully, but these errors were encountered: