2 Detects uses of `Vec::sort_by` passing in a closure
3 which compares the two arguments, either directly or indirectly.
6 It is more clear to use `Vec::sort_by_key` (or `Vec::sort` if
7 possible) than to use `Vec::sort_by` and a more complicated
11 If the suggested `Vec::sort_by_key` uses Reverse and it isn't already
12 imported by a use statement, then it will need to be added manually.
16 vec.sort_by(|a, b| a.foo().cmp(&b.foo()));
20 vec.sort_by_key(|a| a.foo());