From 687bec117c0a59dc58daf5c9954c906eeb60de21 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 13 Mar 2020 17:58:49 +0100 Subject: Don't use generic DB where a concrete one will do --- crates/ra_ide/src/completion/presentation.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'crates/ra_ide') diff --git a/crates/ra_ide/src/completion/presentation.rs b/crates/ra_ide/src/completion/presentation.rs index 910844244..253848602 100644 --- a/crates/ra_ide/src/completion/presentation.rs +++ b/crates/ra_ide/src/completion/presentation.rs @@ -1,6 +1,6 @@ //! This modules takes care of rendering various definitions as completion items. -use hir::{db::HirDatabase, Docs, HasAttrs, HasSource, HirDisplay, ScopeDef, StructKind, Type}; +use hir::{Docs, HasAttrs, HasSource, HirDisplay, ScopeDef, StructKind, Type}; use join_to_string::join; use ra_syntax::ast::NameOwner; use test_utils::tested_by; @@ -9,7 +9,10 @@ use crate::completion::{ CompletionContext, CompletionItem, CompletionItemKind, CompletionKind, Completions, }; -use crate::display::{const_label, macro_label, type_label, FunctionSignature}; +use crate::{ + display::{const_label, macro_label, type_label, FunctionSignature}, + RootDatabase, +}; impl Completions { pub(crate) fn add_field( @@ -300,7 +303,7 @@ impl Completions { } } -fn is_deprecated(node: impl HasAttrs, db: &impl HirDatabase) -> bool { +fn is_deprecated(node: impl HasAttrs, db: &RootDatabase) -> bool { node.attrs(db).by_key("deprecated").exists() } -- cgit v1.2.3