From 4e90d6c21114cdf1b422b1ca5e5d6fc23044a3fd Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 3 Dec 2026 00:09:32 -0800 Subject: [PATCH] Scripts: same_folder builds without a needless bool on Windows On Windows the Unix block in same_folder is compiled out, which left `if a == b { return true; } false` and failed clippy's needless_bool lint with -D warnings in the Windows CI run. The early return now sits inside the Unix block and the other platforms compare the paths. Behavior is unchanged on every platform. --- crates/engine/src/script/dom/raster_capture.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/script/dom/raster_capture.rs b/crates/engine/src/script/dom/raster_capture.rs index 36fec48381..38c8eb5437 100644 --- a/crates/engine/src/script/dom/raster_capture.rs +++ b/crates/engine/src/script/dom/raster_capture.rs @@ -386,17 +386,21 @@ thread_local! { /// file number, so a path spelled in another letter case on a volume that ignores case still /// matches. On Windows a real path carries the letter case stored on disk. fn same_folder(a: &std::path::Path, b: &std::path::Path) -> bool { - if a == b { - return true; - } #[cfg(unix)] { use std::os::unix::fs::MetadataExt; + if a == b { + return true; + } if let (Ok(x), Ok(y)) = (std::fs::metadata(a), std::fs::metadata(b)) { return x.dev() == y.dev() && x.ino() == y.ino(); } + false + } + #[cfg(not(unix))] + { + a == b } - false } /// Whether two existing paths name one file on disk, such as two hard links to it: the same device