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 1a950cd commit 98d769aCopy full SHA for 98d769a
crates/ra_assists/src/split_import.rs
@@ -10,7 +10,10 @@ pub(crate) fn split_import(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assis
10
let path = ast::Path::cast(colon_colon.parent())?;
11
let top_path = successors(Some(path), |it| it.parent_path()).last()?;
12
13
- let _use_tree = top_path.syntax().ancestors().find_map(ast::UseTree::cast)?;
+ let use_tree = top_path.syntax().ancestors().find_map(ast::UseTree::cast);
14
+ if use_tree.is_none() {
15
+ return None;
16
+ }
17
18
let l_curly = colon_colon.range().end();
19
let r_curly = match top_path.syntax().parent().and_then(ast::UseTree::cast) {
0 commit comments