From f1c6f50d9a7f111b843951fa5ad517052d35caef Mon Sep 17 00:00:00 2001 From: Mick Grove Date: Mon, 18 May 2026 15:51:16 -0700 Subject: [PATCH] preparing for v1.100.0 --- crates/kingfisher-scanner/Cargo.toml | 1 + src/decompress.rs | 4 +++- src/scanner/enumerate.rs | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/kingfisher-scanner/Cargo.toml b/crates/kingfisher-scanner/Cargo.toml index efcc753..745952c 100644 --- a/crates/kingfisher-scanner/Cargo.toml +++ b/crates/kingfisher-scanner/Cargo.toml @@ -24,6 +24,7 @@ validation-http = [ "dep:liquid-core", "dep:quick-xml", "dep:sha1", + "dep:hex", "dep:time", ] diff --git a/src/decompress.rs b/src/decompress.rs index 0ece0ec..6fd03b7 100644 --- a/src/decompress.rs +++ b/src/decompress.rs @@ -229,7 +229,9 @@ pub fn extract_zip_archive_in_memory( /// short-circuit extraction attempts on blobs whose extension matches a /// ZIP-based format but whose contents are not actually a real ZIP. pub fn looks_like_zip(data: &[u8]) -> bool { - matches!(data.get(..4), Some(b"PK\x03\x04" | b"PK\x05\x06" | b"PK\x07\x08")) + data.starts_with(b"PK\x03\x04") + || data.starts_with(b"PK\x05\x06") + || data.starts_with(b"PK\x07\x08") } fn handle_zip_archive_streaming( diff --git a/src/scanner/enumerate.rs b/src/scanner/enumerate.rs index 4702711..1e0cd83 100644 --- a/src/scanner/enumerate.rs +++ b/src/scanner/enumerate.rs @@ -841,9 +841,9 @@ impl<'a> rayon::iter::ParallelIterator for GitRepoResultIter<'a> { }; // After flat-mapping, errors and successes both flow as - // `Result<(OriginSet, Blob)>`. Filter out the silenced timeout + // `Result<(OriginSet, Blob<'a>)>`. Filter out the silenced timeout // marker before handing items to the scan consumer. - let timeout_filter = |res: &Result<(OriginSet, Blob)>| -> bool { + let timeout_filter = |res: &Result<(OriginSet, Blob<'a>)>| -> bool { !matches!(res, Err(e) if e.to_string() == "__timeout_silenced__") };