From 6c79be913033cc6d1cb941f513dd79ae25bbd970 Mon Sep 17 00:00:00 2001 From: OneSlips Date: Mon, 12 Oct 2026 02:32:08 +1000 Subject: [PATCH] Windows: desktop entry paths, toolchain lints desktop_exec treats a freedesktop Exec path as absolute when it starts with '/' on every platform (Path::is_absolute wants a drive letter on Windows); fill_box uses as_chunks (clippy::chunks_exact_to_as_chunks); LibraryLock::descriptor_copy is cfg(all(test, unix)) like its only test. Co-Authored-By: Claude Opus 5.5 --- apps/lightcraft/src/editors.rs | 6 ++++-- crates/catalog/src/lock.rs | 5 +++-- crates/pipeline/src/spots.rs | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/lightcraft/src/editors.rs b/apps/lightcraft/src/editors.rs index 9a8cc22d2..8b99e284d 100644 --- a/apps/lightcraft/src/editors.rs +++ b/apps/lightcraft/src/editors.rs @@ -172,8 +172,10 @@ fn desktop_exec(entry: &str) -> Option { Some(rest) => rest.split('"').next()?, None => exec.split_whitespace().next()?, }; - // a bare name (`photocraft %F`) was already looked for on the PATH - Some(PathBuf::from(program)).filter(|p| p.is_absolute()) + // a bare name (`photocraft %F`) was already looked for on the PATH. Desktop entries are a + // freedesktop (POSIX) format: absolute means a leading `/` on every platform the parser runs on + // (`Path::is_absolute` wants a drive letter on Windows, where the tests run too) + program.starts_with('/').then(|| PathBuf::from(program)) } #[cfg(test)] diff --git a/crates/catalog/src/lock.rs b/crates/catalog/src/lock.rs index 8a2b496d6..d699da049 100644 --- a/crates/catalog/src/lock.rs +++ b/crates/catalog/src/lock.rs @@ -135,8 +135,9 @@ impl LibraryLock { } /// Another descriptor on the locked file: what a process spawned by another thread holds - /// between fork and exec (a `dup` refers to the same open file description). Tests only. - #[cfg(test)] + /// between fork and exec (a `dup` refers to the same open file description). Tests only (the + /// test that uses it is Unix-only: `flock` semantics). + #[cfg(all(test, unix))] pub(crate) fn descriptor_copy(&self) -> Option { self.file.as_ref().and_then(|f| f.try_clone().ok()) } diff --git a/crates/pipeline/src/spots.rs b/crates/pipeline/src/spots.rs index 483f83f3c..32f55a3c7 100644 --- a/crates/pipeline/src/spots.rs +++ b/crates/pipeline/src/spots.rs @@ -247,7 +247,7 @@ fn fill_box(src: &mut [[f32; 3]], tgt: &[[f32; 3]], alpha: &[f32], bw: usize, bh let flat: Vec = tgt.iter().flatten().copied().collect(); let out = lightcraft_inpaint::complete(bw, bh, 3, &flat, &hole, &lightcraft_inpaint::CompleteParams::default()) .unwrap_or_else(|| lightcraft_inpaint::membrane_fill(bw, bh, 3, &flat, &hole)); - for (d, v) in src.iter_mut().zip(out.chunks_exact(3)) { + for (d, v) in src.iter_mut().zip(out.as_chunks::<3>().0) { *d = [v[0], v[1], v[2]]; } }