From 0daf404ab3c28a14980019a77bc6268fa4243a65 Mon Sep 17 00:00:00 2001 From: ymote <151983+ymote@users.noreply.github.com> Date: Sun, 11 Oct 2026 10:33:20 -0700 Subject: [PATCH] PDF import: take the warnings a patched hayro-interpret adds vectorcraft-pdf matched hayro-interpret's two InterpreterWarning variants exhaustively. A workspace that links PdfCraft beside VectorCraft patches in PdfCraft's hardened hayro-interpret for both ([patch] reaches every crate), and that copy now adds ContentTruncated: page content cut at its safety budget (storytold/pdfcraft#669, storytold/pdfcraft#797). So vectorcraft-pdf stopped compiling there (OctoSense, moving its pdfcraft pin to upstream main). A wildcard arm now reports any further warning as part of a page skipped; against crates.io's hayro-interpret the arm is unreachable and allowed. Co-Authored-By: Claude Opus 5.5 --- crates/pdf/src/import.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/pdf/src/import.rs b/crates/pdf/src/import.rs index f9f6db07a8..8340a0ed65 100644 --- a/crates/pdf/src/import.rs +++ b/crates/pdf/src/import.rs @@ -164,6 +164,11 @@ pub fn import_with_report(bytes: &[u8], opts: &ImportOptions) -> Result "a font could not be read; its text was skipped", InterpreterWarning::ImageDecodeFailure => "an image could not be decoded and was skipped", + // A workspace that patches in another hayro-interpret can have more warnings: PdfCraft's + // hardened copy adds ContentTruncated (page content cut at its safety budget). With + // crates.io's two, this arm is unreachable. + #[allow(unreachable_patterns)] + _ => "part of a page's content could not be read and was skipped", }; if let Ok(mut v) = sink2.lock() && !v.iter().any(|x| x == msg)