aboutsummaryrefslogtreecommitdiff
path: root/crates/assists/src/handlers/auto_import.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-09-29 11:29:33 +0100
committerGitHub <[email protected]>2020-09-29 11:29:33 +0100
commit18c62c8a39d95ce3bb10ff5446bb589b1128a090 (patch)
treef829779003722fb50082b5aa55a725aed841d449 /crates/assists/src/handlers/auto_import.rs
parent7b674f9ab491fdd01278c21f539e65239518e296 (diff)
parentf2ae412ccfa96c4bde42f0b004594c4d6fa54634 (diff)
Merge #6019
6019: Remove make::path_from_text r=matklad a=Veykril This removes the `make::path_from_text` function, which according to a note should've been private. I removed it since it didn't really serve a purpose as it was simply wrapping `make::ast_from_text`. Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/assists/src/handlers/auto_import.rs')
-rw-r--r--crates/assists/src/handlers/auto_import.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/crates/assists/src/handlers/auto_import.rs b/crates/assists/src/handlers/auto_import.rs
index ee7277c04..fa524ffd9 100644
--- a/crates/assists/src/handlers/auto_import.rs
+++ b/crates/assists/src/handlers/auto_import.rs
@@ -1,6 +1,5 @@
1use std::collections::BTreeSet; 1use std::collections::BTreeSet;
2 2
3use ast::make;
4use either::Either; 3use either::Either;
5use hir::{ 4use hir::{
6 AsAssocItem, AssocItemContainer, ModPath, Module, ModuleDef, PathResolution, Semantics, Trait, 5 AsAssocItem, AssocItemContainer, ModPath, Module, ModuleDef, PathResolution, Semantics, Trait,
@@ -54,11 +53,8 @@ pub(crate) fn auto_import(acc: &mut Assists, ctx: &AssistContext) -> Option<()>
54 format!("Import `{}`", &import), 53 format!("Import `{}`", &import),
55 range, 54 range,
56 |builder| { 55 |builder| {
57 let new_syntax = insert_use( 56 let new_syntax =
58 &scope, 57 insert_use(&scope, import.to_ast_path(), ctx.config.insert_use.merge);
59 make::path_from_text(&import.to_string()),
60 ctx.config.insert_use.merge,
61 );
62 builder.replace(syntax.text_range(), new_syntax.to_string()) 58 builder.replace(syntax.text_range(), new_syntax.to_string())
63 }, 59 },
64 ); 60 );