aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_project_model
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_project_model')
-rw-r--r--crates/ra_project_model/src/sysroot.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_project_model/src/sysroot.rs b/crates/ra_project_model/src/sysroot.rs
index 516e0472d..ed374f241 100644
--- a/crates/ra_project_model/src/sysroot.rs
+++ b/crates/ra_project_model/src/sysroot.rs
@@ -89,9 +89,10 @@ fn create_command_text(program: &str, args: &[&str]) -> String {
89 format!("{} {}", program, args.join(" ")) 89 format!("{} {}", program, args.join(" "))
90} 90}
91 91
92fn run_command_in_cargo_dir(cargo_toml: &Path, program: &str, args: &[&str]) -> Result<Output> { 92fn run_command_in_cargo_dir(cargo_toml: impl AsRef<Path>, program: impl AsRef<Path>, args: &[&str]) -> Result<Output> {
93 let program = program.as_ref().as_os_str().to_str().expect("Invalid Unicode in path");
93 let output = Command::new(program) 94 let output = Command::new(program)
94 .current_dir(cargo_toml.parent().unwrap()) 95 .current_dir(cargo_toml.as_ref().parent().unwrap())
95 .args(args) 96 .args(args)
96 .output() 97 .output()
97 .context(format!("{} failed", create_command_text(program, args)))?; 98 .context(format!("{} failed", create_command_text(program, args)))?;