We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1943362 commit 8effa5dCopy full SHA for 8effa5d
src/imports.rs
@@ -689,12 +689,11 @@ impl Ord for UseSegment {
689
impl Ord for UseTree {
690
fn cmp(&self, other: &UseTree) -> Ordering {
691
for (a, b) in self.path.iter().zip(other.path.iter()) {
692
- let ord = a.cmp(b);
693
// The comparison without aliases is a hack to avoid situations like
694
// comparing `a::b` to `a as c` - where the latter should be ordered
695
// first since it is shorter.
696
- if ord != Ordering::Equal && a.remove_alias().cmp(&b.remove_alias()) != Ordering::Equal
697
- {
+ let ord = a.remove_alias().cmp(&b.remove_alias());
+ if ord != Ordering::Equal {
698
return ord;
699
}
700
0 commit comments