aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_db/src/helpers/merge_imports.rs
diff options
context:
space:
mode:
authorLukas Tobias Wirth <[email protected]>2021-05-18 19:21:47 +0100
committerLukas Tobias Wirth <[email protected]>2021-05-19 14:57:10 +0100
commitb4fe479236f592fcbfa1422dda54253b77d8b0e1 (patch)
tree0ce721228484783514b8948a0a64e3e4ca38ea95 /crates/ide_db/src/helpers/merge_imports.rs
parent5fd9f6c7b9944638e4781e3d9384638942f84456 (diff)
Replace ImportGranularity::Guess with guessing boolean flag
Diffstat (limited to 'crates/ide_db/src/helpers/merge_imports.rs')
-rw-r--r--crates/ide_db/src/helpers/merge_imports.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ide_db/src/helpers/merge_imports.rs b/crates/ide_db/src/helpers/merge_imports.rs
index 8fb40e837..546f2d0c4 100644
--- a/crates/ide_db/src/helpers/merge_imports.rs
+++ b/crates/ide_db/src/helpers/merge_imports.rs
@@ -181,7 +181,7 @@ fn recursive_merge(
181} 181}
182 182
183/// Traverses both paths until they differ, returning the common prefix of both. 183/// Traverses both paths until they differ, returning the common prefix of both.
184fn common_prefix(lhs: &ast::Path, rhs: &ast::Path) -> Option<(ast::Path, ast::Path)> { 184pub fn common_prefix(lhs: &ast::Path, rhs: &ast::Path) -> Option<(ast::Path, ast::Path)> {
185 let mut res = None; 185 let mut res = None;
186 let mut lhs_curr = lhs.first_qualifier_or_self(); 186 let mut lhs_curr = lhs.first_qualifier_or_self();
187 let mut rhs_curr = rhs.first_qualifier_or_self(); 187 let mut rhs_curr = rhs.first_qualifier_or_self();
@@ -289,7 +289,7 @@ fn path_segment_cmp(a: &ast::PathSegment, b: &ast::PathSegment) -> Ordering {
289 a.as_ref().map(ast::NameRef::text).cmp(&b.as_ref().map(ast::NameRef::text)) 289 a.as_ref().map(ast::NameRef::text).cmp(&b.as_ref().map(ast::NameRef::text))
290} 290}
291 291
292fn eq_visibility(vis0: Option<ast::Visibility>, vis1: Option<ast::Visibility>) -> bool { 292pub fn eq_visibility(vis0: Option<ast::Visibility>, vis1: Option<ast::Visibility>) -> bool {
293 match (vis0, vis1) { 293 match (vis0, vis1) {
294 (None, None) => true, 294 (None, None) => true,
295 // FIXME: Don't use the string representation to check for equality 295 // FIXME: Don't use the string representation to check for equality