mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
return a PathBuf instead of String
This commit is contained in:
parent
1b76b4281e
commit
44b01ccff3
2 changed files with 9 additions and 8 deletions
|
@ -89,9 +89,10 @@ fn create_command_text(program: &str, args: &[&str]) -> String {
|
|||
format!("{} {}", program, args.join(" "))
|
||||
}
|
||||
|
||||
fn run_command_in_cargo_dir(cargo_toml: &Path, program: &str, args: &[&str]) -> Result<Output> {
|
||||
fn run_command_in_cargo_dir(cargo_toml: impl AsRef<Path>, program: impl AsRef<Path>, args: &[&str]) -> Result<Output> {
|
||||
let program = program.as_ref().as_os_str().to_str().expect("Invalid Unicode in path");
|
||||
let output = Command::new(program)
|
||||
.current_dir(cargo_toml.parent().unwrap())
|
||||
.current_dir(cargo_toml.as_ref().parent().unwrap())
|
||||
.args(args)
|
||||
.output()
|
||||
.context(format!("{} failed", create_command_text(program, args)))?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue