Open
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?