aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_project_model/src
diff options
context:
space:
mode:
authornmio <[email protected]>2020-02-25 20:56:24 +0000
committernmio <[email protected]>2020-02-25 20:56:24 +0000
commitf1b7349e7a929cd55f916fc6cdfa171467ac897d (patch)
treee267d720bf07d0c3399ccafbbef3f1cdf77487ce /crates/ra_project_model/src
parent39bd3b2bd719289a8dd03fb52d5060cdb10f9169 (diff)
clean up
Diffstat (limited to 'crates/ra_project_model/src')
-rw-r--r--crates/ra_project_model/src/lib.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/crates/ra_project_model/src/lib.rs b/crates/ra_project_model/src/lib.rs
index a8594a697..cfebf36f8 100644
--- a/crates/ra_project_model/src/lib.rs
+++ b/crates/ra_project_model/src/lib.rs
@@ -421,19 +421,14 @@ fn find_cargo_toml_down_the_fs(path: &Path) -> Option<PathBuf> {
421} 421}
422 422
423fn find_cargo_toml_up_the_fs(path: &Path) -> Option<PathBuf> { 423fn find_cargo_toml_up_the_fs(path: &Path) -> Option<PathBuf> {
424 log::info!("find_cargo_toml_up_the_fs()");
425 let entities = match read_dir(path) { 424 let entities = match read_dir(path) {
426 Ok(entities) => entities, 425 Ok(entities) => entities,
427 Err(e) => { 426 Err(_) => return None
428 log::info!("err {}", e);
429 return None
430 }
431 }; 427 };
432 428
433 log::info!("entities: {:?}", entities); 429 // Only one level up to avoid cycles the easy way and stop a runaway scan with large projects
434 for entity in entities.filter_map(Result::ok) { 430 for entity in entities.filter_map(Result::ok) {
435 let candidate = entity.path().join("Cargo.toml"); 431 let candidate = entity.path().join("Cargo.toml");
436 log::info!("candidate: {:?}, exists: {}", candidate, candidate.exists());
437 if candidate.exists() { 432 if candidate.exists() {
438 return Some(candidate); 433 return Some(candidate);
439 } 434 }