aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/server_world.rs
diff options
context:
space:
mode:
authorMuhammad Mominul Huque <[email protected]>2018-10-11 19:07:44 +0100
committerMuhammad Mominul Huque <[email protected]>2018-10-11 19:07:44 +0100
commitdc2b30e9b6084048e441765b91ef830a836d3dfc (patch)
treed36cc20ef7c43d33488706cd65427e5d8922430c /crates/ra_lsp_server/src/server_world.rs
parent9b155c89764b8413df6b32edfde94fce1d9c15ec (diff)
Replace HashMap, HashSet with FxHashMap and FxHashSet
Diffstat (limited to 'crates/ra_lsp_server/src/server_world.rs')
-rw-r--r--crates/ra_lsp_server/src/server_world.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_lsp_server/src/server_world.rs b/crates/ra_lsp_server/src/server_world.rs
index 865f7c491..c4cdf83d4 100644
--- a/crates/ra_lsp_server/src/server_world.rs
+++ b/crates/ra_lsp_server/src/server_world.rs
@@ -1,10 +1,10 @@
1use std::{ 1use std::{
2 fs, 2 fs,
3 path::{PathBuf, Path}, 3 path::{PathBuf, Path},
4 collections::HashMap,
5 sync::Arc, 4 sync::Arc,
6}; 5};
7 6
7use rustc_hash::FxHashMap;
8use languageserver_types::Url; 8use languageserver_types::Url;
9use ra_analysis::{FileId, AnalysisHost, Analysis, CrateGraph, CrateId, LibraryData, FileResolver}; 9use ra_analysis::{FileId, AnalysisHost, Analysis, CrateGraph, CrateId, LibraryData, FileResolver};
10 10
@@ -20,7 +20,7 @@ pub struct ServerWorldState {
20 pub workspaces: Arc<Vec<CargoWorkspace>>, 20 pub workspaces: Arc<Vec<CargoWorkspace>>,
21 pub analysis_host: AnalysisHost, 21 pub analysis_host: AnalysisHost,
22 pub path_map: PathMap, 22 pub path_map: PathMap,
23 pub mem_map: HashMap<FileId, Option<String>>, 23 pub mem_map: FxHashMap<FileId, Option<String>>,
24} 24}
25 25
26#[derive(Clone)] 26#[derive(Clone)]
@@ -36,7 +36,7 @@ impl ServerWorldState {
36 workspaces: Arc::new(Vec::new()), 36 workspaces: Arc::new(Vec::new()),
37 analysis_host: AnalysisHost::new(), 37 analysis_host: AnalysisHost::new(),
38 path_map: PathMap::new(), 38 path_map: PathMap::new(),
39 mem_map: HashMap::new(), 39 mem_map: FxHashMap::default(),
40 } 40 }
41 } 41 }
42 pub fn apply_fs_changes(&mut self, events: Vec<FileEvent>) { 42 pub fn apply_fs_changes(&mut self, events: Vec<FileEvent>) {
@@ -121,7 +121,7 @@ impl ServerWorldState {
121 Ok(file_id) 121 Ok(file_id)
122 } 122 }
123 pub fn set_workspaces(&mut self, ws: Vec<CargoWorkspace>) { 123 pub fn set_workspaces(&mut self, ws: Vec<CargoWorkspace>) {
124 let mut crate_roots = HashMap::new(); 124 let mut crate_roots = FxHashMap::default();
125 ws.iter() 125 ws.iter()
126 .flat_map(|ws| { 126 .flat_map(|ws| {
127 ws.packages() 127 ws.packages()