Avoid turning path into strings when not needed

This commit is contained in:
Roey Darwish Dror
2019-05-15 10:59:05 +03:00
parent 5c3e81b325
commit 93d3eb2bc3
3 changed files with 7 additions and 9 deletions

View File

@@ -43,7 +43,9 @@ impl Emacs {
run_type
.execute(&emacs)
.args(&["--batch", "-l", init_file.to_str().unwrap(), "--eval", EMACS_UPGRADE])
.args(&["--batch", "-l"])
.arg(init_file)
.args(&["--eval", EMACS_UPGRADE])
.check_run()
}
}

View File

@@ -297,10 +297,7 @@ pub fn run_snap(sudo: Option<&PathBuf>, run_type: RunType) -> Result<(), Error>
}
print_separator("snap");
run_type
.execute(sudo)
.args(&[snap.to_str().unwrap(), "refresh"])
.check_run()
run_type.execute(sudo).arg(snap).arg("refresh").check_run()
}
#[must_use]
@@ -309,7 +306,7 @@ pub fn run_etc_update(sudo: Option<&PathBuf>, run_type: RunType) -> Result<(), E
let etc_update = require("etc_update")?;
print_separator("etc-update");
run_type.execute(sudo).arg(&etc_update.to_str().unwrap()).check_run()
run_type.execute(sudo).arg(etc_update).check_run()
}
#[cfg(test)]

View File

@@ -61,10 +61,9 @@ fn nvimrc(base_dirs: &BaseDirs) -> Option<PathBuf> {
fn upgrade(vim: &PathBuf, vimrc: &PathBuf, plugin_framework: PluginFramework, run_type: RunType) -> Result<(), Error> {
run_type
.execute(&vim)
.args(&["-N", "-u"])
.arg(vimrc)
.args(&[
"-N",
"-u",
vimrc.to_str().unwrap(),
"-c",
plugin_framework.upgrade_command(),
"-c",