Skip to content

Commit ccb75f7

Browse files
committed
Use FxHashMap
1 parent 4496e2a commit ccb75f7

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/ra_assists/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ doctest = false
1010
[dependencies]
1111
format-buf = "1.0.0"
1212
join_to_string = "0.1.3"
13+
rustc-hash = "1.0"
1314
itertools = "0.8.0"
1415

1516
ra_syntax = { path = "../ra_syntax" }

crates/ra_assists/src/ast_transform.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! `AstTransformer`s are functions that replace nodes in an AST and can be easily combined.
2-
use std::collections::HashMap;
2+
use rustc_hash::FxHashMap;
33

44
use hir::{db::HirDatabase, InFile, PathResolution};
55
use ra_syntax::ast::{self, make, AstNode};
@@ -35,7 +35,7 @@ impl<'a> AstTransform<'a> for NullTransformer {
3535

3636
pub struct SubstituteTypeParams<'a, DB: HirDatabase> {
3737
db: &'a DB,
38-
substs: HashMap<hir::TypeParam, ast::TypeRef>,
38+
substs: FxHashMap<hir::TypeParam, ast::TypeRef>,
3939
previous: Box<dyn AstTransform<'a> + 'a>,
4040
}
4141

@@ -47,7 +47,7 @@ impl<'a, DB: HirDatabase> SubstituteTypeParams<'a, DB> {
4747
) -> SubstituteTypeParams<'a, DB> {
4848
let substs = get_syntactic_substs(impl_block).unwrap_or_default();
4949
let generic_def: hir::GenericDef = trait_.into();
50-
let substs_by_param: HashMap<_, _> = generic_def
50+
let substs_by_param: FxHashMap<_, _> = generic_def
5151
.params(db)
5252
.into_iter()
5353
// this is a trait impl, so we need to skip the first type parameter -- this is a bit hacky

0 commit comments

Comments
 (0)