mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-28 20:17:18 -06:00
Windows / clippy 1.98: as_chunks in the spot fill, unix-only lock test helper
`cargo xtask ci` failed at clippy on Windows with Rust 1.98.1 before any feature work: - crates/pipeline/src/spots.rs: clippy::chunks_exact_to_as_chunks (new lint); `as_chunks::<3>()` is what crates/codecs already uses, same behaviour, no indexing. - crates/catalog/src/lock.rs: `descriptor_copy` is only used by a `#[cfg(unix)]` test, so it was dead code in Windows test builds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
76b5377868
commit
9ae3b365a1
@@ -135,8 +135,8 @@ 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). Unix tests only.
|
||||
#[cfg(all(test, unix))]
|
||||
pub(crate) fn descriptor_copy(&self) -> Option<File> {
|
||||
self.file.as_ref().and_then(|f| f.try_clone().ok())
|
||||
}
|
||||
|
||||
@@ -247,8 +247,8 @@ fn fill_box(src: &mut [[f32; 3]], tgt: &[[f32; 3]], alpha: &[f32], bw: usize, bh
|
||||
let flat: Vec<f32> = 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)) {
|
||||
*d = [v[0], v[1], v[2]];
|
||||
for (d, v) in src.iter_mut().zip(out.as_chunks::<3>().0) {
|
||||
*d = *v;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user