From 2d544f18b53102a11bc80be4e986c7f52f5262de Mon Sep 17 00:00:00 2001 From: liv Date: Wed, 17 May 2023 21:04:32 +0200 Subject: [PATCH] fix: revert back to using relative paths --- src/project.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/project.rs b/src/project.rs index 7865d92..ebebe27 100644 --- a/src/project.rs +++ b/src/project.rs @@ -1,9 +1,9 @@ use glob::glob; use serde::{Deserialize, Serialize}; +use std::env; use std::error::Error; use std::path::PathBuf; use std::process::Command; -use std::{env, fs}; /// Contains the structure of resulting rust-project.json file /// and functions to build the data required to create the file @@ -42,9 +42,8 @@ impl RustAnalyzerProject { fn path_to_json(&mut self, path: PathBuf) -> Result<(), Box> { if let Some(ext) = path.extension() { if ext == "rs" { - let abspath = fs::canonicalize(path)?; self.crates.push(Crate { - root_module: abspath.display().to_string(), + root_module: path.display().to_string(), edition: "2021".to_string(), deps: Vec::new(), // This allows rust_analyzer to work inside #[test] blocks