From 5f8fa66b77d33b6adfcfa20d138f9dd3a8de35b4 Mon Sep 17 00:00:00 2001 From: ShuiRuTian <158983297@qq.com> Date: Wed, 13 Jan 2021 00:53:17 +0800 Subject: use path rather than hard code. --- crates/rust-analyzer/tests/rust-analyzer/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates') diff --git a/crates/rust-analyzer/tests/rust-analyzer/main.rs b/crates/rust-analyzer/tests/rust-analyzer/main.rs index 787239385..97f06d94c 100644 --- a/crates/rust-analyzer/tests/rust-analyzer/main.rs +++ b/crates/rust-analyzer/tests/rust-analyzer/main.rs @@ -744,8 +744,8 @@ fn test_will_rename_files_same_level() { // } let tmp_dir = TestDir::new(); let tmp_dir_path = tmp_dir.path().to_owned(); - let tmp_dir_path = tmp_dir_path.to_str().unwrap(); - let base_path = PathBuf::from(format!("file://{}", tmp_dir_path)); + let tmp_dir_str = tmp_dir_path.to_str().unwrap(); + let base_path = PathBuf::from(format!("file://{}", tmp_dir_str)); let code = r#" //- /Cargo.toml @@ -784,7 +784,7 @@ fn main() {} "documentChanges": [ { "textDocument": { - "uri": format!("file://{}/src/lib.rs", tmp_dir_path), + "uri": format!("file://{}", tmp_dir_path.join("src").join("lib.rs")), "version": null }, "edits": [ @@ -845,7 +845,7 @@ fn main() {} "documentChanges": [ { "textDocument": { - "uri": format!("file://{}/src/lib.rs", tmp_dir_path), + "uri": format!("file://{}", tmp_dir_path.join("src").join("lib.rs")), "version": null }, "edits": [ -- cgit v1.2.3