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

@@ -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)]