-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
A-lintArea: New lintsArea: New lintsE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.Call for participation: Medium difficulty level problem and requires some initial experience.L-correctnessLint: Belongs in the correctness lint groupLint: Belongs in the correctness lint groupgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy
Description
I had a very weird bug today, I was trying to sort my list using a somewhat complicated key expression with sort_by_key
, but no sorting was happening it was like getting a random order.
Turns out I had an extra semicolon at the end of my expression, making my key return ()
instead which implements Ord
(always Equal
).
Example:
vec.sort_by_key(|x| {
some_function(some_expression(x));
// ^---- extra semicolon here
});
Metadata
Metadata
Assignees
Labels
A-lintArea: New lintsArea: New lintsE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.Call for participation: Medium difficulty level problem and requires some initial experience.L-correctnessLint: Belongs in the correctness lint groupLint: Belongs in the correctness lint groupgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy