mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-14 19:27:04 -04:00
CI: as_chunks instead of constant-size chunks_exact (clippy 1.99 chunks_exact_to_as_chunks)
Stable clippy 1.99 denies chunks_exact/chunks_exact_mut with a constant size (32 sites), which failed the test job on main and every open PR. Behaviour unchanged; MSRV 1.90 has as_chunks. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
788456a8e7
commit
ab47bf4b9a
19 files changed
+41
-33
No files matched your search
@@ -364,7 +364,7 @@ fn collect_outline(doc: &Document, node: ObjectId, out: &mut Vec<ObjectId>) {
|
||||
/// Decode a PDF text string (UTF-16BE with BOM, else treated as Latin-1).
|
||||
fn decode_text(bytes: &[u8]) -> String {
|
||||
if let Some(rest) = bytes.strip_prefix(&[0xfe, 0xff]) {
|
||||
let units: Vec<u16> = rest.chunks_exact(2).map(|c| u16::from_be_bytes([c[0], c[1]])).collect();
|
||||
let units: Vec<u16> = rest.as_chunks::<2>().0.iter().map(|c| u16::from_be_bytes([c[0], c[1]])).collect();
|
||||
String::from_utf16_lossy(&units)
|
||||
} else {
|
||||
bytes.iter().map(|&b| b as char).collect()
|
||||
|
||||
Reference in new issue
Block a user