mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
clean up
This commit is contained in:
parent
39bd3b2bd7
commit
f1b7349e7a
1 changed files with 2 additions and 7 deletions
|
@ -421,19 +421,14 @@ fn find_cargo_toml_down_the_fs(path: &Path) -> Option<PathBuf> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn find_cargo_toml_up_the_fs(path: &Path) -> Option<PathBuf> {
|
fn find_cargo_toml_up_the_fs(path: &Path) -> Option<PathBuf> {
|
||||||
log::info!("find_cargo_toml_up_the_fs()");
|
|
||||||
let entities = match read_dir(path) {
|
let entities = match read_dir(path) {
|
||||||
Ok(entities) => entities,
|
Ok(entities) => entities,
|
||||||
Err(e) => {
|
Err(_) => return None
|
||||||
log::info!("err {}", e);
|
|
||||||
return None
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
log::info!("entities: {:?}", entities);
|
// Only one level up to avoid cycles the easy way and stop a runaway scan with large projects
|
||||||
for entity in entities.filter_map(Result::ok) {
|
for entity in entities.filter_map(Result::ok) {
|
||||||
let candidate = entity.path().join("Cargo.toml");
|
let candidate = entity.path().join("Cargo.toml");
|
||||||
log::info!("candidate: {:?}, exists: {}", candidate, candidate.exists());
|
|
||||||
if candidate.exists() {
|
if candidate.exists() {
|
||||||
return Some(candidate);
|
return Some(candidate);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue