From cb1e787e8eaea78eaa8c774a446d35680a123633 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Fri, 19 Jan 2024 10:49:02 +0100 Subject: [PATCH] cleanup unnecessary allocation Signed-off-by: Wolfgang Bumiller --- src/api2/node/certificates.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/api2/node/certificates.rs b/src/api2/node/certificates.rs index b44697c4..6dfcd0c0 100644 --- a/src/api2/node/certificates.rs +++ b/src/api2/node/certificates.rs @@ -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()) -- 2.39.2