From 97ab471b6dadf69292d760cc5fcac695ddc5e240 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 18 Feb 2020 18:52:33 +0100 Subject: Minor simplification --- crates/ra_ide/src/syntax_highlighting.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs index 20c414ca1..1e5e0f420 100644 --- a/crates/ra_ide/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs @@ -95,7 +95,6 @@ pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Vec { if let Some(token) = node.as_token() { if let Some((tag, binding_hash)) = highlight_token_tree( - db, &mut sb, &analyzer, &mut bindings_shadow_count, @@ -111,7 +110,6 @@ pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Vec { if let Some((tag, binding_hash)) = highlight_node( - db, &mut sb, &mut bindings_shadow_count, InFile::new(file_id.into(), node.clone()), @@ -151,7 +149,6 @@ fn highlight_macro(node: InFile) -> Option { } fn highlight_token_tree( - db: &RootDatabase, sb: &mut SourceBinder, analyzer: &SourceAnalyzer, bindings_shadow_count: &mut FxHashMap, @@ -160,7 +157,7 @@ fn highlight_token_tree( if token.value.parent().kind() != TOKEN_TREE { return None; } - let token = descend_into_macros_with_analyzer(db, analyzer, token); + let token = descend_into_macros_with_analyzer(sb.db, analyzer, token); let expanded = { let parent = token.value.parent(); // We only care Name and Name_ref @@ -170,15 +167,15 @@ fn highlight_token_tree( } }; - highlight_node(db, sb, bindings_shadow_count, expanded) + highlight_node(sb, bindings_shadow_count, expanded) } fn highlight_node( - db: &RootDatabase, sb: &mut SourceBinder, bindings_shadow_count: &mut FxHashMap, node: InFile, ) -> Option<(&'static str, Option)> { + let db = sb.db; let mut binding_hash = None; let tag = match node.value.kind() { FN_DEF => { -- cgit v1.2.3