Avoid turning path into strings when not needed
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user