aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/assists/split_import.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists/src/assists/split_import.rs')
-rw-r--r--crates/ra_assists/src/assists/split_import.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/crates/ra_assists/src/assists/split_import.rs b/crates/ra_assists/src/assists/split_import.rs
index 6038c4858..2c3f07a79 100644
--- a/crates/ra_assists/src/assists/split_import.rs
+++ b/crates/ra_assists/src/assists/split_import.rs
@@ -1,6 +1,5 @@
1use std::iter::successors; 1use std::iter::successors;
2 2
3use hir::db::HirDatabase;
4use ra_syntax::{ast, AstNode, TextUnit, T}; 3use ra_syntax::{ast, AstNode, TextUnit, T};
5 4
6use crate::{Assist, AssistCtx, AssistId}; 5use crate::{Assist, AssistCtx, AssistId};
@@ -16,7 +15,7 @@ use crate::{Assist, AssistCtx, AssistId};
16// ``` 15// ```
17// use std::{collections::HashMap}; 16// use std::{collections::HashMap};
18// ``` 17// ```
19pub(crate) fn split_import(ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> { 18pub(crate) fn split_import(ctx: AssistCtx) -> Option<Assist> {
20 let colon_colon = ctx.find_token_at_offset(T![::])?; 19 let colon_colon = ctx.find_token_at_offset(T![::])?;
21 let path = ast::Path::cast(colon_colon.parent())?; 20 let path = ast::Path::cast(colon_colon.parent())?;
22 let top_path = successors(Some(path), |it| it.parent_path()).last()?; 21 let top_path = successors(Some(path), |it| it.parent_path()).last()?;