From 0010d62cad875aac76cad0efd143d4a318e8d2cd Mon Sep 17 00:00:00 2001 From: pcpthm Date: Thu, 4 Apr 2019 18:57:10 +0900 Subject: Make robust about target directory --- crates/ra_batch/src/lib.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/ra_batch/src/lib.rs b/crates/ra_batch/src/lib.rs index 3bbcdb0b8..5bb47afb2 100644 --- a/crates/ra_batch/src/lib.rs +++ b/crates/ra_batch/src/lib.rs @@ -126,10 +126,7 @@ mod tests { #[test] fn test_loading_rust_analyzer() { - let mut path = std::env::current_exe().unwrap(); - while !path.join("Cargo.toml").is_file() { - path = path.parent().unwrap().to_owned(); - } + let path = Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap().parent().unwrap(); let (db, roots) = BatchDatabase::load_cargo(path).unwrap(); let mut n_crates = 0; for root in roots { -- cgit v1.2.3