]> git.proxmox.com Git - proxmox-backup.git/commitdiff
cleanup unnecessary allocation
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 19 Jan 2024 09:49:02 +0000 (10:49 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 19 Jan 2024 09:49:02 +0000 (10:49 +0100)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/api2/node/certificates.rs

index b44697c42dbd913e47814803697062f1319431ef..6dfcd0c0626e0dec41e0fe7bf9b90dba72b074b9 100644 (file)
@@ -1,4 +1,3 @@
-use std::path::PathBuf;
 use std::sync::Arc;
 use std::time::Duration;
 
@@ -203,10 +202,7 @@ pub async fn upload_custom_certificate(
 
     let key = match key {
         Some(key) => key,
-        None => {
-            let key_path = PathBuf::from(configdir!("/proxy.key"));
-            proxmox_sys::fs::file_read_string(key_path)?
-        }
+        None => proxmox_sys::fs::file_read_string(configdir!("/proxy.key"))?,
     };
 
     let key = PKey::private_key_from_pem(key.as_bytes())