aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorpcpthm <[email protected]>2019-04-04 10:57:10 +0100
committerpcpthm <[email protected]>2019-04-04 10:57:10 +0100
commit0010d62cad875aac76cad0efd143d4a318e8d2cd (patch)
tree6107e790eaca45a6bbc0231ea36ab19390296be3 /crates
parentc083515eec3db48bb0226d198e7b1af3bc7eef05 (diff)
Make robust about target directory
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_batch/src/lib.rs5
1 files changed, 1 insertions, 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 {
126 126
127 #[test] 127 #[test]
128 fn test_loading_rust_analyzer() { 128 fn test_loading_rust_analyzer() {
129 let mut path = std::env::current_exe().unwrap(); 129 let path = Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap().parent().unwrap();
130 while !path.join("Cargo.toml").is_file() {
131 path = path.parent().unwrap().to_owned();
132 }
133 let (db, roots) = BatchDatabase::load_cargo(path).unwrap(); 130 let (db, roots) = BatchDatabase::load_cargo(path).unwrap();
134 let mut n_crates = 0; 131 let mut n_crates = 0;
135 for root in roots { 132 for root in roots {