mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-13 17:13:48 +00:00
clean up
This commit is contained in:
parent
39bd3b2bd7
commit
f1b7349e7a
@ -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> {
|
||||
log::info!("find_cargo_toml_up_the_fs()");
|
||||
let entities = match read_dir(path) {
|
||||
Ok(entities) => entities,
|
||||
Err(e) => {
|
||||
log::info!("err {}", e);
|
||||
return None
|
||||
}
|
||||
Err(_) => 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) {
|
||||
let candidate = entity.path().join("Cargo.toml");
|
||||
log::info!("candidate: {:?}, exists: {}", candidate, candidate.exists());
|
||||
if candidate.exists() {
|
||||
return Some(candidate);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user