From 6008fd56a1b672e43ce6e099ffc8634f3d098fe8 Mon Sep 17 00:00:00 2001 From: stevenhorsman Date: Tue, 28 Jan 2025 15:30:16 +0000 Subject: [PATCH] agent: Fix clippy error ``` error: file opened with `create`, but `truncate` behavior not defined ``` `truncate(true)` ensures the file is entirely overwritten with new data which I believe is the behaviour we want Signed-off-by: stevenhorsman --- src/agent/src/mount.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/agent/src/mount.rs b/src/agent/src/mount.rs index 018e0a071b..ec7cf7dff1 100644 --- a/src/agent/src/mount.rs +++ b/src/agent/src/mount.rs @@ -537,6 +537,7 @@ mod tests { OpenOptions::new() .create(true) + .truncate(true) .write(true) .open(test_file_filename) .expect("failed to create test file");