-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Redundant x_by
and x_by_key
#2313
Comments
Just a reminder about the different conditions; |
@bluss I don't see why that'd be the case when |
The compiler will tell you if you try 😉 |
Oh! I see. It's a lifetime error in the original definition of the function.
Should be:
|
Your definition is not valid - the elements move during sort. |
No, but the elements do not need to be moved, simply compared. I'll write something up tomorrow to demonstrate. |
…oh, I see the problem. |
For example, these:
could become:
This also applies to
binary_search_by
and similar methods.Perhaps we could also add a lint for adding
_by
but not_by_key
when implementing a type.Demonstrated on indexmap-rs/indexmap#55.
The text was updated successfully, but these errors were encountered: