diff options
Diffstat (limited to 'crates/ra_assists/src/ast_transform.rs')
-rw-r--r-- | crates/ra_assists/src/ast_transform.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_assists/src/ast_transform.rs b/crates/ra_assists/src/ast_transform.rs index ace59f290..cbddc50ac 100644 --- a/crates/ra_assists/src/ast_transform.rs +++ b/crates/ra_assists/src/ast_transform.rs | |||
@@ -1,5 +1,5 @@ | |||
1 | //! `AstTransformer`s are functions that replace nodes in an AST and can be easily combined. | 1 | //! `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; |
3 | 3 | ||
4 | use hir::{db::HirDatabase, InFile, PathResolution}; | 4 | use hir::{db::HirDatabase, InFile, PathResolution}; |
5 | use ra_syntax::ast::{self, make, AstNode}; | 5 | use ra_syntax::ast::{self, make, AstNode}; |
@@ -35,7 +35,7 @@ impl<'a> AstTransform<'a> for NullTransformer { | |||
35 | 35 | ||
36 | pub struct SubstituteTypeParams<'a, DB: HirDatabase> { | 36 | pub struct SubstituteTypeParams<'a, DB: HirDatabase> { |
37 | db: &'a DB, | 37 | db: &'a DB, |
38 | substs: HashMap<hir::TypeParam, ast::TypeRef>, | 38 | substs: FxHashMap<hir::TypeParam, ast::TypeRef>, |
39 | previous: Box<dyn AstTransform<'a> + 'a>, | 39 | previous: Box<dyn AstTransform<'a> + 'a>, |
40 | } | 40 | } |
41 | 41 | ||
@@ -47,7 +47,7 @@ impl<'a, DB: HirDatabase> SubstituteTypeParams<'a, DB> { | |||
47 | ) -> SubstituteTypeParams<'a, DB> { | 47 | ) -> SubstituteTypeParams<'a, DB> { |
48 | let substs = get_syntactic_substs(impl_block).unwrap_or_default(); | 48 | let substs = get_syntactic_substs(impl_block).unwrap_or_default(); |
49 | let generic_def: hir::GenericDef = trait_.into(); | 49 | let generic_def: hir::GenericDef = trait_.into(); |
50 | let substs_by_param: HashMap<_, _> = generic_def | 50 | let substs_by_param: FxHashMap<_, _> = generic_def |
51 | .params(db) | 51 | .params(db) |
52 | .into_iter() | 52 | .into_iter() |
53 | // this is a trait impl, so we need to skip the first type parameter -- this is a bit hacky | 53 | // this is a trait impl, so we need to skip the first type parameter -- this is a bit hacky |