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 f0546fe commit 0b588faCopy full SHA for 0b588fa
rustfmt-core/rustfmt-lib/src/imports.rs
@@ -726,7 +726,8 @@ impl Ord for UseTree {
726
}
727
728
729
- self.path.len().cmp(&other.path.len())
+ Ord::cmp(&self.path.len(), &other.path.len())
730
+ .then(Ord::cmp(&self.path.last(), &other.path.last()))
731
732
733
rustfmt-core/rustfmt-lib/tests/target/imports-reorder-lines.rs
@@ -15,14 +15,14 @@ use aaa::*;
15
mod test {}
16
// If item names are equal, order by rename
17
18
-use test::{a as bb, b};
19
use test::{a as aa, c};
+use test::{a as bb, b};
20
21
22
// If item names are equal, order by rename - no rename comes before a rename
23
24
25
use test::{a, c};
26
27
28
// `self` always comes first
0 commit comments