From a4d93b14622fb27118157f49fd83cfd39d363fa0 Mon Sep 17 00:00:00 2001 From: theironchef <6278036+theironchef@users.noreply.github.com> Date: Mon, 5 Oct 2026 12:17:22 -0700 Subject: [PATCH] Lint: as_chunks in the font scan too The system font scan reads collection offsets and table records with chunks_exact; clippy 1.99 asks for as_chunks there as well. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01U9TrG4w49oSRYbP3cqxA3D --- crates/text/src/fontdb.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/text/src/fontdb.rs b/crates/text/src/fontdb.rs index eafe9cf4..8a48f7e9 100644 --- a/crates/text/src/fontdb.rs +++ b/crates/text/src/fontdb.rs @@ -259,7 +259,7 @@ fn file_face_names(path: &Path) -> Vec<(String, String)> { // A collection lists where each face's table directory starts. let starts: Vec = if head.starts_with(b"ttcf") { let n = be32(&head, 8).unwrap_or(0).min(MAX_FACES) as usize; - read_at(12, n * 4).map(|b| b.chunks_exact(4).filter_map(|c| be32(c, 0)).collect()).unwrap_or_default() + read_at(12, n * 4).map(|b| b.as_chunks::<4>().0.iter().map(|c| u32::from_be_bytes(*c)).collect()).unwrap_or_default() } else { vec![0] }; @@ -269,7 +269,7 @@ fn file_face_names(path: &Path) -> Vec<(String, String)> { let dir = read_at(start.into(), 12)?; let tables = u16::from_be_bytes(dir.get(4..6)?.try_into().ok()?) as usize; let records = read_at(u64::from(start) + 12, tables * 16)?; - let rec = records.chunks_exact(16).find(|r| r.starts_with(b"name"))?; + let rec: &[u8] = records.as_chunks::<16>().0.iter().find(|r| r.starts_with(b"name"))?; let (offset, len) = (be32(rec, 8)?, be32(rec, 12)?); if len > MAX_NAME_TABLE { return None;