From 8119eece43ac3402e49c282cbedfec31e6759bea Mon Sep 17 00:00:00 2001 From: noah1400 <48360809+noah1400@users.noreply.github.com> Date: Sun, 11 Oct 2026 19:39:09 +0200 Subject: [PATCH] Recovery: `run_dir` passes clippy on Windows (#496) The builder for a run's folder was `mut` only for the mode that Unix sets, so `-D warnings` rejected it everywhere else. The folder is now made the way `secure_recovery_dir` makes the recovery folder: with its mode on Unix, and with `create_dir` elsewhere. --- crates/engine/src/recovery.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/recovery.rs b/crates/engine/src/recovery.rs index 058495791..a8b23e8b7 100644 --- a/crates/engine/src/recovery.rs +++ b/crates/engine/src/recovery.rs @@ -66,13 +66,16 @@ pub fn run_dir(root: &Path) -> Result { let dir = root.join(format!("run-{}-{n}", std::process::id())); // Only a folder this run makes is its own. One that is there is another app's, or was // left by a run that ended under this process id. - let mut new = std::fs::DirBuilder::new(); #[cfg(unix)] - { + let made = { use std::os::unix::fs::DirBuilderExt; - new.mode(0o700); - } - match new.create(&dir) { + + let mut builder = std::fs::DirBuilder::new(); + builder.mode(0o700).create(&dir) + }; + #[cfg(not(unix))] + let made = std::fs::create_dir(&dir); + match made { Ok(()) => {} Err(e) if e.kind() == std::io::ErrorKind::AlreadyExists => continue, Err(e) => return Err(EngineError::Other(format!("{}: {e}", dir.display()))),