Closed
Description
For example, these:
x.sort_by(|l, r| l.cmp(r))
y.sort_by(|l, r| l.0.cmp(r.0))
could become:
x.sort();
y.sort_by_key(|z| z.0);
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.
Metadata
Metadata
Assignees
Labels
No labels