From dc2b30e9b6084048e441765b91ef830a836d3dfc Mon Sep 17 00:00:00 2001 From: Muhammad Mominul Huque Date: Fri, 12 Oct 2018 00:07:44 +0600 Subject: Replace HashMap, HashSet with FxHashMap and FxHashSet --- crates/ra_editor/src/completion.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/ra_editor/src/completion.rs') diff --git a/crates/ra_editor/src/completion.rs b/crates/ra_editor/src/completion.rs index 570d72d66..20b8484b3 100644 --- a/crates/ra_editor/src/completion.rs +++ b/crates/ra_editor/src/completion.rs @@ -1,4 +1,4 @@ -use std::collections::{HashSet, HashMap}; +use rustc_hash::{FxHashMap, FxHashSet}; use ra_syntax::{ File, TextUnit, AstNode, SyntaxNodeRef, SyntaxKind::*, @@ -96,7 +96,7 @@ fn complete_name_ref(file: &File, name_ref: ast::NameRef, acc: &mut Vec) { - let mut params = HashMap::new(); + let mut params = FxHashMap::default(); for node in ctx.ancestors() { let _ = visitor_ctx(&mut params) .visit::(process) @@ -114,7 +114,7 @@ fn param_completions(ctx: SyntaxNodeRef, acc: &mut Vec) { }) }); - fn process<'a, N: ast::FnDefOwner<'a>>(node: N, params: &mut HashMap)>) { + fn process<'a, N: ast::FnDefOwner<'a>>(node: N, params: &mut FxHashMap)>) { node.functions() .filter_map(|it| it.param_list()) .flat_map(|it| it.params()) @@ -232,7 +232,7 @@ fn complete_mod_item_snippets(acc: &mut Vec) { } fn complete_fn(name_ref: ast::NameRef, scopes: &FnScopes, acc: &mut Vec) { - let mut shadowed = HashSet::new(); + let mut shadowed = FxHashSet::default(); acc.extend( scopes.scope_chain(name_ref.syntax()) .flat_map(|scope| scopes.entries(scope).iter()) -- cgit v1.2.3