Aleksey Kladov 1834bae5b8 allow rustfmt to reorder imports
This wasn't a right decision in the first place, the feature flag was
broken in the last rustfmt release, and syntax highlighting of imports
is more important anyway
2019-07-04 23:09:09 +03:00

24 lines
623 B
Rust

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()
},
)
}