Unmix error handling when discovering workspaces

Hitting an io::Error is a legit problem. Finding more than one
Cargo.toml is not.
This commit is contained in:
Aleksey Kladov
2020-04-16 22:19:38 +02:00
parent be2654b0ed
commit 422ae477ce
3 changed files with 41 additions and 75 deletions

View File

@@ -27,7 +27,7 @@ pub(crate) fn load_cargo(
load_out_dirs_from_check: bool,
) -> Result<(AnalysisHost, FxHashMap<SourceRootId, PackageRoot>)> {
let root = std::env::current_dir()?.join(root);
let root = ProjectRoot::discover(&root)?;
let root = ProjectRoot::discover_single(&root)?;
let ws = ProjectWorkspace::load(
root,
&CargoConfig { load_out_dirs_from_check, ..Default::default() },