diff options
Diffstat (limited to 'crates/ra_analysis/src')
-rw-r--r-- | crates/ra_analysis/src/db/mod.rs | 4 | ||||
-rw-r--r-- | crates/ra_analysis/src/roots.rs | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_analysis/src/db/mod.rs b/crates/ra_analysis/src/db/mod.rs index c54d50252..c84bfa7a8 100644 --- a/crates/ra_analysis/src/db/mod.rs +++ b/crates/ra_analysis/src/db/mod.rs | |||
@@ -2,9 +2,9 @@ use std::{ | |||
2 | fmt, | 2 | fmt, |
3 | sync::Arc, | 3 | sync::Arc, |
4 | hash::{Hash, Hasher}, | 4 | hash::{Hash, Hasher}, |
5 | collections::HashSet, | ||
6 | }; | 5 | }; |
7 | use salsa; | 6 | use salsa; |
7 | use rustc_hash::FxHashSet; | ||
8 | use ra_syntax::File; | 8 | use ra_syntax::File; |
9 | use ra_editor::{LineIndex}; | 9 | use ra_editor::{LineIndex}; |
10 | use crate::{ | 10 | use crate::{ |
@@ -63,7 +63,7 @@ salsa::query_group! { | |||
63 | 63 | ||
64 | #[derive(Default, Debug)] | 64 | #[derive(Default, Debug)] |
65 | pub(crate) struct FileSet { | 65 | pub(crate) struct FileSet { |
66 | pub(crate) files: HashSet<FileId>, | 66 | pub(crate) files: FxHashSet<FileId>, |
67 | pub(crate) resolver: FileResolverImp, | 67 | pub(crate) resolver: FileResolverImp, |
68 | } | 68 | } |
69 | 69 | ||
diff --git a/crates/ra_analysis/src/roots.rs b/crates/ra_analysis/src/roots.rs index 908f49b0a..692a07ccd 100644 --- a/crates/ra_analysis/src/roots.rs +++ b/crates/ra_analysis/src/roots.rs | |||
@@ -1,5 +1,4 @@ | |||
1 | use std::{ | 1 | use std::{ |
2 | collections::{HashMap, HashSet}, | ||
3 | sync::Arc, | 2 | sync::Arc, |
4 | panic, | 3 | panic, |
5 | }; | 4 | }; |
@@ -8,6 +7,7 @@ use parking_lot::RwLock; | |||
8 | use once_cell::sync::OnceCell; | 7 | use once_cell::sync::OnceCell; |
9 | use rayon::prelude::*; | 8 | use rayon::prelude::*; |
10 | use salsa::Database; | 9 | use salsa::Database; |
10 | use rustc_hash::{FxHashMap, FxHashSet}; | ||
11 | use ra_editor::LineIndex; | 11 | use ra_editor::LineIndex; |
12 | use ra_syntax::File; | 12 | use ra_syntax::File; |
13 | 13 | ||
@@ -40,8 +40,8 @@ impl WritableSourceRoot { | |||
40 | file_resolver: Option<FileResolverImp>, | 40 | file_resolver: Option<FileResolverImp>, |
41 | ) -> WritableSourceRoot { | 41 | ) -> WritableSourceRoot { |
42 | let db = self.db.write(); | 42 | let db = self.db.write(); |
43 | let mut changed = HashSet::new(); | 43 | let mut changed = FxHashSet::default(); |
44 | let mut removed = HashSet::new(); | 44 | let mut removed = FxHashSet::default(); |
45 | for (file_id, text) in changes { | 45 | for (file_id, text) in changes { |
46 | match text { | 46 | match text { |
47 | None => { | 47 | None => { |
@@ -55,7 +55,7 @@ impl WritableSourceRoot { | |||
55 | } | 55 | } |
56 | } | 56 | } |
57 | let file_set = db.file_set(()); | 57 | let file_set = db.file_set(()); |
58 | let mut files: HashSet<FileId> = file_set | 58 | let mut files: FxHashSet<FileId> = file_set |
59 | .files | 59 | .files |
60 | .clone(); | 60 | .clone(); |
61 | for file_id in removed { | 61 | for file_id in removed { |