From a49949388b338fddbf044ba23719c45dccca36f8 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Tue, 17 Nov 2026 05:52:32 +0100 Subject: [PATCH] fix(test): allow the unused mut on Windows in the private test folders (#7595) #5923 made the pptx LibreOffice test and the staging tests build their folders with a DirBuilder that only Unix sets a mode on. On Windows the binding is never changed, so -D warnings stops the build with unused_mut and main's Windows gate is red. --- crates/export/src/pptx/tests.rs | 2 ++ crates/platform/src/staging/tests.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/crates/export/src/pptx/tests.rs b/crates/export/src/pptx/tests.rs index 06cd21ad5f..2ed0235778 100644 --- a/crates/export/src/pptx/tests.rs +++ b/crates/export/src/pptx/tests.rs @@ -382,6 +382,8 @@ fn pptx_opens_in_libreoffice() { // A new folder of our own, never one left (or planted) at a guessable name. let nanos = std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).map_or(0, |d| d.as_nanos()); let dir = std::env::temp_dir().join(format!("pdfcraft-pptx-lo-{}-{nanos:x}", std::process::id())); + // Only Unix sets a mode on it, so elsewhere `made` is never changed. + #[cfg_attr(not(unix), allow(unused_mut))] let mut made = std::fs::DirBuilder::new(); #[cfg(unix)] { diff --git a/crates/platform/src/staging/tests.rs b/crates/platform/src/staging/tests.rs index d489c4551a..52fe846988 100644 --- a/crates/platform/src/staging/tests.rs +++ b/crates/platform/src/staging/tests.rs @@ -6,6 +6,8 @@ fn test_dir(test: &str) -> PathBuf { let seed = std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).map_or(0, |d| d.as_nanos()); for n in 0..64u32 { let dir = std::env::temp_dir().join(format!("pdfcraft-platform-staging-{}-{test}-{:x}", std::process::id(), seed.wrapping_add(n.into()))); + // Only Unix sets a mode on it, so elsewhere `made` is never changed. + #[cfg_attr(not(unix), allow(unused_mut))] let mut made = std::fs::DirBuilder::new(); #[cfg(unix)] {