Skip to content

Commit 98d769a

Browse files
committed
readability
1 parent 1a950cd commit 98d769a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crates/ra_assists/src/split_import.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ pub(crate) fn split_import(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assis
1010
let path = ast::Path::cast(colon_colon.parent())?;
1111
let top_path = successors(Some(path), |it| it.parent_path()).last()?;
1212

13-
let _use_tree = top_path.syntax().ancestors().find_map(ast::UseTree::cast)?;
13+
let use_tree = top_path.syntax().ancestors().find_map(ast::UseTree::cast);
14+
if use_tree.is_none() {
15+
return None;
16+
}
1417

1518
let l_curly = colon_colon.range().end();
1619
let r_curly = match top_path.syntax().parent().and_then(ast::UseTree::cast) {

0 commit comments

Comments
 (0)