-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
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-styleLint: Belongs in the style lint groupLint: Belongs in the style lint group
Description
The if_same_then_else lint triggered on the following code I use to sort some stuff:
positions.sort_by(|&(x1, y1, z1), &(x2, y2, z2)| {
use std::cmp::Ordering::*;
if z1 < z2 {
Less
} else if z1 > z2 {
Greater
} else if x1 > x2 {
Less
} else if x1 < x2 {
Greater
} else if y1 < y2 {
Less
} else {
Greater
}
});
I'm not sure if Clippy could reason about this or if it's even worth the trouble thinking about that but perhaps this is worthy of a footnote in the wiki?
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-styleLint: Belongs in the style lint groupLint: Belongs in the style lint group