Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-db/src/imports/merge_imports.rs')
| -rw-r--r-- | crates/ide-db/src/imports/merge_imports.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ide-db/src/imports/merge_imports.rs b/crates/ide-db/src/imports/merge_imports.rs index c0ff332a23..7ec38c317d 100644 --- a/crates/ide-db/src/imports/merge_imports.rs +++ b/crates/ide-db/src/imports/merge_imports.rs @@ -112,7 +112,7 @@ fn recursive_merge(lhs: &ast::UseTree, rhs: &ast::UseTree, merge: MergeBehavior) .collect::<Option<_>>()?; // Sorts the use trees similar to rustfmt's algorithm for ordering imports // (see `use_tree_cmp` doc). - use_trees.sort_unstable_by(|a, b| use_tree_cmp(a, b)); + use_trees.sort_unstable_by(use_tree_cmp); for rhs_t in rhs.use_tree_list().into_iter().flat_map(|list| list.use_trees()) { if !merge.is_tree_allowed(&rhs_t) { return None; @@ -365,7 +365,7 @@ fn path_segment_cmp(a: &ast::PathSegment, b: &ast::PathSegment) -> Ordering { if is_upper_snake_case(a_text) && !is_upper_snake_case(b_text) { return Ordering::Greater; } - a_text.cmp(&b_text) + a_text.cmp(b_text) } } } |