From b762de9fec4adaa57f515f01bb098e8ce47b27e3 Mon Sep 17 00:00:00 2001 From: Julian Stecklina Date: Wed, 28 Dec 2022 23:49:45 +0100 Subject: [PATCH] lanzatool: remove Path -> String conversions in signature module --- rust/lanzatool/src/signature.rs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/rust/lanzatool/src/signature.rs b/rust/lanzatool/src/signature.rs index e910c9d..d7ac85f 100644 --- a/rust/lanzatool/src/signature.rs +++ b/rust/lanzatool/src/signature.rs @@ -1,10 +1,9 @@ +use std::ffi::OsString; use std::path::{Path, PathBuf}; use std::process::Command; use anyhow::Result; -use crate::utils; - pub struct KeyPair { pub private_key: PathBuf, pub public_key: PathBuf, @@ -19,14 +18,14 @@ impl KeyPair { } pub fn sign_and_copy(&self, from: &Path, to: &Path) -> Result<()> { - let args = vec![ - String::from("--key"), - utils::path_to_string(&self.private_key), - String::from("--cert"), - utils::path_to_string(&self.public_key), - utils::path_to_string(from), - String::from("--output"), - utils::path_to_string(to), + let args: Vec = vec![ + OsString::from("--key"), + self.private_key.clone().into(), + OsString::from("--cert"), + self.public_key.clone().into(), + from.as_os_str().to_owned(), + OsString::from("--output"), + to.as_os_str().to_owned(), ]; let output = Command::new("sbsign").args(&args).output()?;