From 88267c86c0c49de395973574d2516ab904091cfb Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 6 Feb 2020 12:52:32 +0100 Subject: cleanup imports --- crates/ra_ide/src/display/function_signature.rs | 17 ++++++----------- crates/ra_ide/src/display/navigation_target.rs | 3 ++- 2 files changed, 8 insertions(+), 12 deletions(-) (limited to 'crates/ra_ide/src/display') diff --git a/crates/ra_ide/src/display/function_signature.rs b/crates/ra_ide/src/display/function_signature.rs index 1e4a472b4..c23e08e9a 100644 --- a/crates/ra_ide/src/display/function_signature.rs +++ b/crates/ra_ide/src/display/function_signature.rs @@ -4,13 +4,11 @@ use std::fmt::{self, Display}; use hir::{Docs, Documentation, HasSource, HirDisplay}; use join_to_string::join; +use ra_ide_db::RootDatabase; use ra_syntax::ast::{self, AstNode, NameOwner, VisibilityOwner}; use std::convert::From; -use crate::{ - db, - display::{generic_parameters, where_predicates}, -}; +use crate::display::{generic_parameters, where_predicates}; #[derive(Debug)] pub enum CallableKind { @@ -48,13 +46,13 @@ impl FunctionSignature { self } - pub(crate) fn from_hir(db: &db::RootDatabase, function: hir::Function) -> Self { + pub(crate) fn from_hir(db: &RootDatabase, function: hir::Function) -> Self { let doc = function.docs(db); let ast_node = function.source(db).value; FunctionSignature::from(&ast_node).with_doc_opt(doc) } - pub(crate) fn from_struct(db: &db::RootDatabase, st: hir::Struct) -> Option { + pub(crate) fn from_struct(db: &RootDatabase, st: hir::Struct) -> Option { let node: ast::StructDef = st.source(db).value; match node.kind() { ast::StructKind::Record(_) => return None, @@ -86,10 +84,7 @@ impl FunctionSignature { ) } - pub(crate) fn from_enum_variant( - db: &db::RootDatabase, - variant: hir::EnumVariant, - ) -> Option { + pub(crate) fn from_enum_variant(db: &RootDatabase, variant: hir::EnumVariant) -> Option { let node: ast::EnumVariant = variant.source(db).value; match node.kind() { ast::StructKind::Record(_) | ast::StructKind::Unit => return None, @@ -126,7 +121,7 @@ impl FunctionSignature { ) } - pub(crate) fn from_macro(db: &db::RootDatabase, macro_def: hir::MacroDef) -> Option { + pub(crate) fn from_macro(db: &RootDatabase, macro_def: hir::MacroDef) -> Option { let node: ast::MacroCall = macro_def.source(db).value; let params = vec![]; diff --git a/crates/ra_ide/src/display/navigation_target.rs b/crates/ra_ide/src/display/navigation_target.rs index b2af3479c..906aab1eb 100644 --- a/crates/ra_ide/src/display/navigation_target.rs +++ b/crates/ra_ide/src/display/navigation_target.rs @@ -3,6 +3,7 @@ use either::Either; use hir::{AssocItem, FieldSource, HasSource, InFile, ModuleSource}; use ra_db::{FileId, SourceDatabase}; +use ra_ide_db::RootDatabase; use ra_syntax::{ ast::{self, DocCommentsOwner, NameOwner}, match_ast, AstNode, SmolStr, @@ -10,7 +11,7 @@ use ra_syntax::{ TextRange, }; -use crate::{db::RootDatabase, expand::original_range, FileSymbol}; +use crate::{expand::original_range, FileSymbol}; use super::short_label::ShortLabel; -- cgit v1.2.3