chore(text): use is_some_and instead of unnecessary map_or (clippy) (#3929)

This commit is contained in:
Dylan M. Taylor
2026-10-23 22:39:51 -04:00
committed by GitHub
parent 76467a1a9b
commit 6c05c10fff
+1 -1
View File
@@ -104,7 +104,7 @@ fn has_compressed_metadata(bytes: &[u8]) -> bool {
fn itxt_uncompressed(bytes: &[u8], head_at: usize, len: u32) -> bool {
let from = head_at + 8;
let data = bytes.get(from..from.saturating_add(len as usize)).unwrap_or(&[]);
data.iter().position(|&b| b == 0).and_then(|kw| data.get(kw + 1)).map_or(false, |&flag| flag == 0)
data.iter().position(|&b| b == 0).and_then(|kw| data.get(kw + 1)).is_some_and(|&flag| flag == 0)
}
/// The width and height in PNG `bytes`' header (its signature, then the IHDR chunk); `None` when