aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/project_model.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-12-18 09:45:20 +0000
committerAleksey Kladov <[email protected]>2018-12-18 09:52:17 +0000
commit193992fd14e88d91a3695f10204232d4c81192dc (patch)
treefced7beb98137d8675e0f864c7b41c909b97ebf5 /crates/ra_lsp_server/src/project_model.rs
parent4a1ab869b7aaa38d55e8995ec1b49e72b55a5965 (diff)
move thread worker to a separate crate
Diffstat (limited to 'crates/ra_lsp_server/src/project_model.rs')
-rw-r--r--crates/ra_lsp_server/src/project_model.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/crates/ra_lsp_server/src/project_model.rs b/crates/ra_lsp_server/src/project_model.rs
index cb91ada90..b881f8b6f 100644
--- a/crates/ra_lsp_server/src/project_model.rs
+++ b/crates/ra_lsp_server/src/project_model.rs
@@ -4,11 +4,9 @@ use cargo_metadata::{metadata_run, CargoOpt};
4use ra_syntax::SmolStr; 4use ra_syntax::SmolStr;
5use rustc_hash::{FxHashMap, FxHashSet}; 5use rustc_hash::{FxHashMap, FxHashSet};
6use failure::{format_err, bail}; 6use failure::{format_err, bail};
7use thread_worker::{WorkerHandle, Worker};
7 8
8use crate::{ 9use crate::Result;
9 Result,
10 thread_watcher::{ThreadWatcher, Worker},
11};
12 10
13/// `CargoWorksapce` represents the logical structure of, well, a Cargo 11/// `CargoWorksapce` represents the logical structure of, well, a Cargo
14/// workspace. It pretty closely mirrors `cargo metadata` output. 12/// workspace. It pretty closely mirrors `cargo metadata` output.
@@ -199,8 +197,8 @@ impl TargetKind {
199 } 197 }
200} 198}
201 199
202pub fn workspace_loader() -> (Worker<PathBuf, Result<CargoWorkspace>>, ThreadWatcher) { 200pub fn workspace_loader() -> (Worker<PathBuf, Result<CargoWorkspace>>, WorkerHandle) {
203 Worker::<PathBuf, Result<CargoWorkspace>>::spawn( 201 thread_worker::spawn::<PathBuf, Result<CargoWorkspace>, _>(
204 "workspace loader", 202 "workspace loader",
205 1, 203 1,
206 |input_receiver, output_sender| { 204 |input_receiver, output_sender| {