Skip to content

DesignCraft: An open-source page and layout design editor written by scratch in pure Rust

Integration: recovery folders build on Windows without an unused mut (#506)

aiongg933cfb11e65a
diff --git a/crates/engine/src/recovery.rs b/crates/engine/src/recovery.rs
index 6a5a6d327..6fbdfe0f4 100644
--- a/crates/engine/src/recovery.rs
+++ b/crates/engine/src/recovery.rs
@@ -66,12 +66,15 @@ pub fn run_dir(root: &Path) -> Result<PathBuf> {
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 new = {
use std::os::unix::fs::DirBuilderExt;
+ let mut new = std::fs::DirBuilder::new();
new.mode(0o700);
- }
+ new
+ };
+ #[cfg(not(unix))]
+ let new = std::fs::DirBuilder::new();
match new.create(&dir) {
Ok(()) => {}
Err(e) if e.kind() == std::io::ErrorKind::AlreadyExists => continue,