From a640bb86ecdc6a568a58ca84b06111edeb59a025 Mon Sep 17 00:00:00 2001 From: stevenhorsman Date: Tue, 28 Jan 2025 15:29:04 +0000 Subject: [PATCH] agent: cdh: Remove unnecessary borrows Fix clippy error: ``` error: the borrowed expression implements the required traits ``` Signed-off-by: stevenhorsman --- src/agent/src/cdh.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/agent/src/cdh.rs b/src/agent/src/cdh.rs index deff44cc9e..ba2ac66a03 100644 --- a/src/agent/src/cdh.rs +++ b/src/agent/src/cdh.rs @@ -147,7 +147,7 @@ pub async fn unseal_file(path: &str) -> Result<()> { continue; } - let target_path = fs::canonicalize(&entry.path())?; + let target_path = fs::canonicalize(entry.path())?; info!(sl(), "sealed source entry target path: {:?}", target_path); // Skip if the target path is not a file (e.g., it's a symlink pointing to the secret file). @@ -177,8 +177,8 @@ pub async fn unseal_file(path: &str) -> Result<()> { fs::write(&unsealed_filename, unsealed_value)?; // Remove the original sealed symlink and create a symlink to the unsealed file - fs::remove_file(&entry.path())?; - symlink(unsealed_filename_symlink, &entry.path())?; + fs::remove_file(entry.path())?; + symlink(unsealed_filename_symlink, entry.path())?; } } Ok(())