blob: 1130d08de93b5d8bda362717e63b0654b1c03049 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
use std::path::PathBuf;
use thread_worker::Worker;
use crate::Result;
pub use ra_project_model::{
CargoWorkspace, Package, ProjectWorkspace, Sysroot, Target, TargetKind,
};
pub fn workspace_loader() -> Worker<PathBuf, Result<ProjectWorkspace>> {
Worker::<PathBuf, Result<ProjectWorkspace>>::spawn(
"workspace loader",
1,
|input_receiver, output_sender| {
input_receiver
.into_iter()
.map(|path| ProjectWorkspace::discover(path.as_path()))
.try_for_each(|it| output_sender.send(it))
.unwrap()
},
)
}
|