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 b27348b commit b2ca220Copy full SHA for b2ca220
rustfmt-core/rustfmt-lib/src/imports.rs
@@ -707,12 +707,11 @@ impl Ord for UseSegment {
707
impl Ord for UseTree {
708
fn cmp(&self, other: &UseTree) -> Ordering {
709
for (a, b) in self.path.iter().zip(other.path.iter()) {
710
- let ord = a.cmp(b);
711
// The comparison without aliases is a hack to avoid situations like
712
// comparing `a::b` to `a as c` - where the latter should be ordered
713
// first since it is shorter.
714
- if ord != Ordering::Equal && a.remove_alias().cmp(&b.remove_alias()) != Ordering::Equal
715
- {
+ let ord = a.remove_alias().cmp(&b.remove_alias());
+ if ord != Ordering::Equal {
716
return ord;
717
}
718
0 commit comments