Skip to content

Commit 687bec1

Browse files
committed
Don't use generic DB where a concrete one will do
1 parent 4c85e53 commit 687bec1

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

crates/ra_assists/src/handlers/fill_match_arms.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use std::iter;
44

5-
use hir::{db::HirDatabase, Adt, HasSource, Semantics};
5+
use hir::{Adt, HasSource, Semantics};
66
use ra_syntax::ast::{self, edit::IndentLevel, make, AstNode, NameOwner};
77

88
use crate::{Assist, AssistCtx, AssistId};
@@ -88,11 +88,7 @@ fn resolve_enum_def(sema: &Semantics<RootDatabase>, expr: &ast::Expr) -> Option<
8888
})
8989
}
9090

91-
fn build_pat(
92-
db: &impl HirDatabase,
93-
module: hir::Module,
94-
var: hir::EnumVariant,
95-
) -> Option<ast::Pat> {
91+
fn build_pat(db: &RootDatabase, module: hir::Module, var: hir::EnumVariant) -> Option<ast::Pat> {
9692
let path = crate::ast_transform::path_to_ast(module.find_use_path(db, var.into())?);
9793

9894
// FIXME: use HIR for this; it doesn't currently expose struct vs. tuple vs. unit variants though

crates/ra_ide/src/completion/presentation.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! This modules takes care of rendering various definitions as completion items.
22
3-
use hir::{db::HirDatabase, Docs, HasAttrs, HasSource, HirDisplay, ScopeDef, StructKind, Type};
3+
use hir::{Docs, HasAttrs, HasSource, HirDisplay, ScopeDef, StructKind, Type};
44
use join_to_string::join;
55
use ra_syntax::ast::NameOwner;
66
use test_utils::tested_by;
@@ -9,7 +9,10 @@ use crate::completion::{
99
CompletionContext, CompletionItem, CompletionItemKind, CompletionKind, Completions,
1010
};
1111

12-
use crate::display::{const_label, macro_label, type_label, FunctionSignature};
12+
use crate::{
13+
display::{const_label, macro_label, type_label, FunctionSignature},
14+
RootDatabase,
15+
};
1316

1417
impl Completions {
1518
pub(crate) fn add_field(
@@ -300,7 +303,7 @@ impl Completions {
300303
}
301304
}
302305

303-
fn is_deprecated(node: impl HasAttrs, db: &impl HirDatabase) -> bool {
306+
fn is_deprecated(node: impl HasAttrs, db: &RootDatabase) -> bool {
304307
node.attrs(db).by_key("deprecated").exists()
305308
}
306309

0 commit comments

Comments
 (0)