From 2d4050825d21fd2c8f6d63e86d131a1ec526fcc1 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Fri, 9 Aug 2024 11:06:25 +0200 Subject: [PATCH] sys: don't duplicate the template path Signed-off-by: Wolfgang Bumiller --- proxmox-sys/src/fs/dir.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/proxmox-sys/src/fs/dir.rs b/proxmox-sys/src/fs/dir.rs index 12d1b008..c903ab87 100644 --- a/proxmox-sys/src/fs/dir.rs +++ b/proxmox-sys/src/fs/dir.rs @@ -1,6 +1,5 @@ use std::ffi::OsString; use std::os::fd::FromRawFd; -use std::os::unix::ffi::OsStrExt; use std::os::unix::ffi::OsStringExt; use std::os::unix::io::{AsRawFd, OwnedFd}; use std::path::{Path, PathBuf}; @@ -205,7 +204,7 @@ pub fn make_tmp_dir>( ) -> Result { let template = directory.as_ref().join("tmp_XXXXXX"); - let mut template = template.into_os_string().as_bytes().to_owned(); + let mut template = template.into_os_string().into_vec(); // Push NULL byte so that we have a proper NULL-terminated string template.push(0);