Allow rust-project.json to be hidden

This commit is contained in:
Ali Bektas 2024-08-07 03:27:03 +02:00
parent b23142209e
commit 2426649661
3 changed files with 14 additions and 2 deletions

View file

@ -68,6 +68,9 @@ impl ProjectManifest {
if path.file_name().unwrap_or_default() == "rust-project.json" {
return Ok(ProjectManifest::ProjectJson(path));
}
if path.file_name().unwrap_or_default() == ".rust-project.json" {
return Ok(ProjectManifest::ProjectJson(path));
}
if path.file_name().unwrap_or_default() == "Cargo.toml" {
return Ok(ProjectManifest::CargoToml(path));
}
@ -94,6 +97,9 @@ impl ProjectManifest {
if let Some(project_json) = find_in_parent_dirs(path, "rust-project.json") {
return Ok(vec![ProjectManifest::ProjectJson(project_json)]);
}
if let Some(project_json) = find_in_parent_dirs(path, ".rust-project.json") {
return Ok(vec![ProjectManifest::ProjectJson(project_json)]);
}
return find_cargo_toml(path)
.map(|paths| paths.into_iter().map(ProjectManifest::CargoToml).collect());