diff --git a/notes/bf-1wczm-unmapped-summary.md b/notes/bf-1wczm-unmapped-summary.md new file mode 100644 index 0000000..1b0e216 --- /dev/null +++ b/notes/bf-1wczm-unmapped-summary.md @@ -0,0 +1,46 @@ +# Test Execution Summary: unmapped.rs Test Module + +## Bead ID +bf-1wczm + +## Date Run +2026-07-06 + +## Tests Executed +Test module: `cmap_unmapped_glyphs.rs` (TH-05 unmapped glyph assertions) + +## Command Used +```bash +cargo test -p pdftract-core --test cmap_unmapped_glyphs -- --test-threads=1 +``` + +## Test Results +- **Total tests run:** 7 +- **Passed:** 7 +- **Failed:** 0 +- **Ignored:** 0 +- **Status:** PASS ✓ + +## Tests Passed +1. `test_cmap_multiple_mappings_with_unmapped_check` - Verifies CMAP handles multiple character mappings while checking unmapped glyphs +2. `test_cmap_range_mapping_with_unmapped_awareness` - Tests range mapping with unmapped glyph awareness +3. `test_cmap_unmapped_glyph_skip` - Basic structural test for unmapped glyph name identification +4. `test_differences_overlay_consecutive_with_unmapped_filtering` - Tests consecutive differences overlay with unmapped filtering +5. `test_differences_overlay_filters_all_g_series_unmapped` - Verifies all g-series glyphs are filtered as unmapped +6. `test_differences_overlay_filters_null_glyph` - Tests .null glyph is properly filtered +7. `test_differences_overlay_filters_unmapped_glyphs` - Tests unmapped glyph filtering in differences overlay + +## Completion Status +✓ **Test module completed successfully** - No hangs detected, all tests terminated cleanly. + +## Exit Code +0 (success) + +## Runtime +< 1 second + +## Notes +- All tests in the unmapped glyph assertion module (TH-05) passed +- No hangs or timeouts observed +- Tests verify correct handling of unmapped glyph names (.notdef, .null, g000-fff series) +- Test module is isolated and runs independently without issues diff --git a/notes/bf-1wczm-unmapped.log b/notes/bf-1wczm-unmapped.log new file mode 100644 index 0000000..986b50f --- /dev/null +++ b/notes/bf-1wczm-unmapped.log @@ -0,0 +1,2911 @@ +warning: fields `description` and `version` are never read + --> crates/pdftract-core/build.rs:37:5 + | +21 | struct UnmappedGlyphNamesConfig { + | ------------------------ fields in this struct +... +37 | description: Option, + | ^^^^^^^^^^^ +... +43 | version: Option, + | ^^^^^^^ + | + = note: `UnmappedGlyphNamesConfig` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis + = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default + +warning: `pdftract-core` (build script) generated 1 warning + Compiling pdftract-core v0.1.0 (/home/coding/pdftract/crates/pdftract-core) +warning: unused import: `DestArray` + --> crates/pdftract-core/src/annotation/json.rs:6:32 + | +6 | use crate::annotation::links::{DestArray, FitType, LinkAnnotation}; + | ^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: unused import: `Map` + --> crates/pdftract-core/src/cache/key.rs:10:24 + | +10 | use serde_json::{json, Map, Value}; + | ^^^ + +warning: unused import: `entry_path` + --> crates/pdftract-core/src/cache/lru.rs:8:5 + | +8 | entry_path, parse_opts_hash_from_filename, parse_size_from_filename, sentinel_path, + | ^^^^^^^^^^ + +warning: unused import: `crate::parser::object::PdfObject` + --> crates/pdftract-core/src/conformance.rs:17:5 + | +17 | use crate::parser::object::PdfObject; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `anyhow::Result` + --> crates/pdftract-core/src/conformance.rs:20:5 + | +20 | use anyhow::Result; + | ^^^^^^^^^^^^^^ + +warning: unused import: `intern` + --> crates/pdftract-core/src/content_stream.rs:34:29 + | +34 | use crate::parser::object::{intern, ObjRef, PdfDict, PdfObject}; + | ^^^^^^ + +warning: unused import: `PdfDict` + --> crates/pdftract-core/src/content_stream.rs:1926:41 + | +1926 | use crate::parser::object::{intern, PdfDict}; + | ^^^^^^^ + +warning: unused import: `ObjRef` + --> crates/pdftract-core/src/detection.rs:11:29 + | +11 | use crate::parser::object::{ObjRef, PdfDict, PdfObject}; + | ^^^^^^ + +warning: unused imports: `LinearizationInfo` and `XrefSection` + --> crates/pdftract-core/src/document.rs:21:76 + | +21 | detect_linearization, load_xref_linearized, load_xref_with_prev_chain, LinearizationInfo, + | ^^^^^^^^^^^^^^^^^ +22 | XrefResolver, XrefSection, + | ^^^^^^^^^^^ + +warning: unused import: `DiagCode` + --> crates/pdftract-core/src/encryption/detection.rs:13:19 + | +13 | diagnostics::{DiagCode, Diagnostic}, + | ^^^^^^^^ + +warning: unused import: `derive_aes_128_object_key` + --> crates/pdftract-core/src/encryption/decryptor.rs:12:32 + | +12 | aes_128::{aes_128_decrypt, derive_aes_128_object_key}, + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `secrecy::SecretString` + --> crates/pdftract-core/src/encryption/decryptor.rs:22:5 + | +22 | use secrecy::SecretString; + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `AcroFormField` + --> crates/pdftract-core/src/extract.rs:23:57 + | +23 | acro_field_to_value, combine, walk_acroform_fields, AcroFormField, FormFieldValue, + | ^^^^^^^^^^^^^ + +warning: unused import: `parse_struct_tree` + --> crates/pdftract-core/src/extract.rs:33:60 + | +33 | use crate::parser::struct_tree::{check_coverage_for_pages, parse_struct_tree}; + | ^^^^^^^^^^^^^^^^^ + +warning: unused import: `PageContext` + --> crates/pdftract-core/src/extract.rs:44:64 + | +44 | detect_two_page_tables, grid_to_table_json, GridCandidate, PageContext, TableDetector, + | ^^^^^^^^^^^ + +warning: unused import: `TableSpan` + --> crates/pdftract-core/src/extract.rs:46:39 + | +46 | use crate::table::{TableCell as Cell, TableSpan}; + | ^^^^^^^^^ + +warning: unused imports: `emit_glyph` and `new_raw_glyph_list` + --> crates/pdftract-core/src/extract.rs:49:20 + | +49 | use crate::glyph::{emit_glyph, new_raw_glyph_list, Glyph}; + | ^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ + +warning: unused import: `crate::graphics_state::GraphicsState` + --> crates/pdftract-core/src/extract.rs:50:5 + | +50 | use crate::graphics_state::GraphicsState; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused imports: `BlockInput`, `Block`, `Column`, `Line`, `PageContext as LayoutPageContext`, `assign_columns_to_lines`, `classify_caption`, `classify_code`, `classify_figure`, `classify_formula`, `classify_list`, `classify_watermark`, `compute_baseline`, and `detect_headers_and_footers` + --> crates/pdftract-core/src/extract.rs:53:5 + | +53 | assign_columns_to_lines, build_x0_histogram, classify_caption, classify_code, classify_figure, + | ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ +54 | classify_formula, classify_list, classify_watermark, cluster_spans_into_lines, + | ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ +55 | compute_baseline, detect_headers_and_footers, group_lines_into_blocks, xy_cut, Block, + | ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ +56 | BlockInput, Column, Line, PageContext as LayoutPageContext, + | ^^^^^^^^^^ ^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `Span` + --> crates/pdftract-core/src/extract.rs:59:32 + | +59 | use crate::span::{CssHexColor, Span}; + | ^^^^ + +warning: unused import: `std::cmp::Ordering` + --> crates/pdftract-core/src/extract.rs:67:5 + | +67 | use std::cmp::Ordering; + | ^^^^^^^^^^^^^^^^^^ + +warning: unused import: `crate::parser::xref::XrefResolver` + --> crates/pdftract-core/src/extract.rs:930:13 + | +930 | use crate::parser::xref::XrefResolver; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `crate::diagnostics::DiagCode` + --> crates/pdftract-core/src/font/agl.rs:14:5 + | +14 | use crate::diagnostics::DiagCode; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `std::sync::Arc` + --> crates/pdftract-core/src/font/fingerprint.rs:26:5 + | +26 | use std::sync::Arc; + | ^^^^^^^^^^^^^^ + +warning: unused imports: `lookup_shape` and `phash_glyph` + --> crates/pdftract-core/src/font/resolver.rs:24:26 + | +24 | use crate::font::shape::{lookup_shape, phash_glyph}; + | ^^^^^^^^^^^^ ^^^^^^^^^^^ + +warning: unused import: `crate::font::type3_rasterizer::rasterize_type3_glyph` + --> crates/pdftract-core/src/font/resolver.rs:26:5 + | +26 | use crate::font::type3_rasterizer::rasterize_type3_glyph; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `OpenTypeMetrics` + --> crates/pdftract-core/src/font/type0.rs:11:43 + | +11 | use crate::font::embedded::{EmbeddedFont, OpenTypeMetrics}; + | ^^^^^^^^^^^^^^^ + +warning: unused import: `intern` + --> crates/pdftract-core/src/forms/mod.rs:251:29 + | +251 | use crate::parser::object::{intern, ObjRef, PdfDict, PdfObject}; + | ^^^^^^ + +warning: unused import: `std::sync::Arc` + --> crates/pdftract-core/src/forms/mod.rs:255:5 + | +255 | use std::sync::Arc; + | ^^^^^^^^^^^^^^ + +warning: unused import: `ObjRef` + --> crates/pdftract-core/src/javascript.rs:9:29 + | +9 | use crate::parser::object::{ObjRef, PdfObject}; + | ^^^^^^ + +warning: unused import: `encoding_rs::WINDOWS_1252` + --> crates/pdftract-core/src/layout/correction.rs:16:5 + | +16 | use encoding_rs::WINDOWS_1252; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `crate::font::UnicodeSource` + --> crates/pdftract-core/src/layout/correction.rs:18:5 + | +18 | use crate::font::UnicodeSource; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `Line` + --> crates/pdftract-core/src/layout/correction.rs:20:34 + | +20 | use crate::layout::line::{Block, Line, LineMetadata}; + | ^^^^ + +warning: unused import: `std::sync::Arc` + --> crates/pdftract-core/src/layout/figure.rs:25:5 + | +25 | use std::sync::Arc; + | ^^^^^^^^^^^^^^ + +warning: unused import: `std::sync::OnceLock` + --> crates/pdftract-core/src/layout/list.rs:13:5 + | +13 | use std::sync::OnceLock; + | ^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `std::collections::HashSet` + --> crates/pdftract-core/src/layout/reading_order.rs:20:5 + | +20 | use std::collections::HashSet; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `anyhow::Result` + --> crates/pdftract-core/src/log_policy.rs:20:5 + | +20 | use anyhow::Result; + | ^^^^^^^^^^^^^^ + +warning: unused import: `FitType` + --> crates/pdftract-core/src/output/markdown/links.rs:8:43 + | +8 | use crate::annotation::links::{DestArray, FitType, LinkAnnotation}; + | ^^^^^^^ + +warning: unused import: `crate::page_class::PageClass` + --> crates/pdftract-core/src/output/ndjson/pipeline.rs:15:5 + | +15 | use crate::page_class::PageClass; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `intern` + --> crates/pdftract-core/src/parser/catalog.rs:8:29 + | +8 | use crate::parser::object::{intern, ObjRef, PdfObject}; + | ^^^^^^ + +warning: unused import: `FlateDecoder` + --> crates/pdftract-core/src/parser/hint_stream.rs:382:46 + | +382 | use crate::parser::stream::{get_decoder, FlateDecoder, DEFAULT_MAX_DECOMPRESS_BYTES}; + | ^^^^^^^^^^^^ + +warning: unused import: `crate::parser::object::PdfObject` + --> crates/pdftract-core/src/parser/marked_content.rs:22:5 + | +22 | use crate::parser::object::PdfObject; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `std::collections::HashSet` + --> crates/pdftract-core/src/parser/marked_content.rs:247:9 + | +247 | use std::collections::HashSet; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused doc comment + --> crates/pdftract-core/src/parser/object/cache.rs:50:1 + | +50 | / /// Per-thread resolution depth counter. +51 | | /// +52 | | /// Each thread gets its own independent depth counter, allowing concurrent +53 | | /// page processing in rayon without lock contention. + | |_----------------------------------------------------^ + | | + | rustdoc does not generate documentation for macro invocations + | + = help: to document an item produced by a macro, the macro must produce the documentation as part of its expansion + = note: `#[warn(unused_doc_comments)]` (part of `#[warn(unused)]`) on by default + +warning: unused import: `RESOLVING` + --> crates/pdftract-core/src/parser/object/cache.rs:35:51 + | +35 | use super::cycle::{is_resolving, ResolutionGuard, RESOLVING}; + | ^^^^^^^^^ + +warning: unused doc comment + --> crates/pdftract-core/src/parser/object/cycle.rs:33:1 + | +33 | / /// Per-thread set of object references currently being resolved. +34 | | /// +35 | | /// Each thread gets its own independent HashSet, allowing concurrent +36 | | /// page processing in rayon without lock contention. +37 | | /// +38 | | /// Capacity of 64 is conservative: typical PDF resolution depth is < 10. + | |_------------------------------------------------------------------------^ + | | + | rustdoc does not generate documentation for macro invocations + | + = help: to document an item produced by a macro, the macro must produce the documentation as part of its expansion + +warning: unused import: `intern` + --> crates/pdftract-core/src/parser/ocg.rs:11:29 + | +11 | use crate::parser::object::{intern, ObjRef, PdfDict, PdfObject}; + | ^^^^^^ + +warning: unused import: `intern` + --> crates/pdftract-core/src/parser/pages.rs:14:29 + | +14 | use crate::parser::object::{intern, ObjRef, PdfDict, PdfObject}; + | ^^^^^^ + +warning: unused import: `PdfDict` + --> crates/pdftract-core/src/parser/resources.rs:10:45 + | +10 | use crate::parser::object::{intern, ObjRef, PdfDict, PdfObject}; + | ^^^^^^^ + +warning: unused import: `std::io::Seek` + --> crates/pdftract-core/src/parser/stream.rs:13:5 + | +13 | use std::io::Seek; + | ^^^^^^^^^^^^^ + +warning: unused import: `SeqAccess` + --> crates/pdftract-core/src/parser/stream.rs:3243:42 + | +3243 | use serde::de::{self, MapAccess, SeqAccess, Visitor}; + | ^^^^^^^^^ + +warning: unused import: `bytes::Buf` + --> crates/pdftract-core/src/parser/stream.rs:3333:13 + | +3333 | use bytes::Buf; + | ^^^^^^^^^^ + +warning: unused import: `bytes::Buf` + --> crates/pdftract-core/src/parser/stream.rs:3373:13 + | +3373 | use bytes::Buf; + | ^^^^^^^^^^ + +warning: unused import: `crate::encryption::decryptor::DecryptionContext` + --> crates/pdftract-core/src/parser/stream.rs:3749:13 + | +3749 | use crate::encryption::decryptor::DecryptionContext; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `MarkInfo` + --> crates/pdftract-core/src/parser/struct_tree.rs:696:34 + | +696 | use crate::parser::catalog::{MarkInfo, ReadingOrderAlgorithm}; + | ^^^^^^^^ + +warning: unused import: `PdfStream` + --> crates/pdftract-core/src/parser/xref.rs:10:71 + | +10 | use crate::parser::object::{ObjRef, ObjectParser, PdfDict, PdfObject, PdfStream}; + | ^^^^^^^^^ + +warning: unused import: `MemorySource` + --> crates/pdftract-core/src/parser/xref.rs:11:29 + | +11 | use crate::parser::stream::{MemorySource, PdfSource}; + | ^^^^^^^^^^^^ + +warning: unused import: `memchr` + --> crates/pdftract-core/src/parser/xref.rs:16:14 + | +16 | use memchr::{memchr, memchr_iter}; + | ^^^^^^ + +warning: unused import: `std::sync::Arc` + --> crates/pdftract-core/src/parser/xref.rs:273:13 + | +273 | use std::sync::Arc; + | ^^^^^^^^^^^^^^ + +warning: unused import: `base64::prelude::*` + --> crates/pdftract-core/src/receipts/ocr_fallback.rs:11:5 + | +11 | use base64::prelude::*; + | ^^^^^^^^^^^^^^^^^^ + +warning: unused import: `std::fs::File` + --> crates/pdftract-core/src/source/mod.rs:27:5 + | +27 | use std::fs::File; + | ^^^^^^^^^^^^^ + +warning: unused import: `SeekFrom` + --> crates/pdftract-core/src/source/mod.rs:28:33 + | +28 | use std::io::{self, Read, Seek, SeekFrom}; + | ^^^^^^^^ + +warning: unused import: `std::path::Path` + --> crates/pdftract-core/src/source/mod.rs:29:5 + | +29 | use std::path::Path; + | ^^^^^^^^^^^^^^^ + +warning: unused import: `serde_json::json` + --> crates/pdftract-core/src/schema/mod.rs:22:5 + | +22 | use serde_json::json; + | ^^^^^^^^^^^^^^^^ + +warning: unused import: `crate::fingerprint::compute_fingerprint` + --> crates/pdftract-core/src/sdk.rs:10:5 + | +10 | use crate::fingerprint::compute_fingerprint; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `crate::markdown::page_to_markdown` + --> crates/pdftract-core/src/sdk.rs:11:5 + | +11 | use crate::markdown::page_to_markdown; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `crate::parser::catalog::parse_catalog` + --> crates/pdftract-core/src/sdk.rs:13:5 + | +13 | use crate::parser::catalog::parse_catalog; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused imports: `LazyPageIter`, `PageDict`, and `flatten_page_tree` + --> crates/pdftract-core/src/sdk.rs:14:28 + | +14 | use crate::parser::pages::{flatten_page_tree, LazyPageIter, PageDict}; + | ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^ + +warning: unused imports: `XrefResolver` and `load_xref_with_prev_chain` + --> crates/pdftract-core/src/sdk.rs:16:27 + | +16 | use crate::parser::xref::{load_xref_with_prev_chain, XrefResolver}; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ + +warning: unused import: `crate::source::FileSource` + --> crates/pdftract-core/src/sdk.rs:19:5 + | +19 | use crate::source::FileSource; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `serde_json::Value` + --> crates/pdftract-core/src/sdk.rs:22:5 + | +22 | use serde_json::Value; + | ^^^^^^^^^^^^^^^^^ + +warning: unused import: `std::collections::HashMap` + --> crates/pdftract-core/src/sdk.rs:23:5 + | +23 | use std::collections::HashMap; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused imports: `PdfDict` and `intern` + --> crates/pdftract-core/src/signature/mod.rs:20:29 + | +20 | use crate::parser::object::{intern, ObjRef, PdfDict, PdfObject}; + | ^^^^^^ ^^^^^^^ + +warning: unused import: `std::sync::Arc` + --> crates/pdftract-core/src/signature/mod.rs:22:5 + | +22 | use std::sync::Arc; + | ^^^^^^^^^^^^^^ + +warning: unused import: `crate::table::cell::TableSpan` + --> crates/pdftract-core/src/table/output.rs:7:5 + | +7 | use crate::table::cell::TableSpan; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `anyhow::Result` + --> crates/pdftract-core/src/table/output.rs:9:5 + | +9 | use anyhow::Result; + | ^^^^^^^^^^^^^^ + +warning: unused import: `PdfDict` + --> crates/pdftract-core/src/attachment/filespec.rs:583:41 + | +583 | use crate::parser::object::{intern, PdfDict, PdfObject, PdfStream}; + | ^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: unused import: `PdfDict` + --> crates/pdftract-core/src/attachment/name_tree.rs:420:41 + | +420 | use crate::parser::object::{intern, PdfDict, PdfObject}; + | ^^^^^^^ + +warning: unused import: `std::io::Cursor` + --> crates/pdftract-core/src/audit.rs:183:9 + | +183 | use std::io::Cursor; + | ^^^^^^^^^^^^^^^ + +warning: unused import: `indexmap::indexmap` + --> crates/pdftract-core/src/decoder/jbig2.rs:154:9 + | +154 | use indexmap::indexmap; + | ^^^^^^^^^^^^^^^^^^ + +warning: unused import: `crate::diagnostics::DiagCode` + --> crates/pdftract-core/src/extract.rs:3004:13 + | +3004 | use crate::diagnostics::DiagCode; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `std::sync::Arc` + --> crates/pdftract-core/src/forms/mod.rs:836:9 + | +836 | use std::sync::Arc; + | ^^^^^^^^^^^^^^ + +warning: unused import: `super::*` + --> crates/pdftract-core/src/layout/correction.rs:1215:9 + | +1215 | use super::*; + | ^^^^^^^^ + +warning: unused import: `std::io::Cursor` + --> crates/pdftract-core/src/output/ndjson/frames.rs:286:9 + | +286 | use std::io::Cursor; + | ^^^^^^^^^^^^^^^ + +warning: unused import: `super::*` + --> crates/pdftract-core/src/output/ndjson/pipeline.rs:141:9 + | +141 | use super::*; + | ^^^^^^^^ + +warning: unused import: `std::hash::Hasher` + --> crates/pdftract-core/src/page_class.rs:248:13 + | +248 | use std::hash::Hasher; + | ^^^^^^^^^^^^^^^^^ + +warning: unused import: `std::sync::Arc` + --> crates/pdftract-core/src/parser/ocg.rs:427:9 + | +427 | use std::sync::Arc; + | ^^^^^^^^^^^^^^ + +warning: unused import: `Hasher` + --> crates/pdftract-core/src/parser/stream.rs:1919:31 + | +1919 | use std::hash::{Hash, Hasher}; + | ^^^^^^ + +warning: unused import: `secrecy::ExposeSecret` + --> crates/pdftract-core/src/parser/stream.rs:3997:9 + | +3997 | use secrecy::ExposeSecret; + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `secrecy::SecretString` + --> crates/pdftract-core/src/parser/stream.rs:5118:13 + | +5118 | use secrecy::SecretString; + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `Jbig2GlobalsRef` + --> crates/pdftract-core/src/parser/stream.rs:6139:51 + | +6139 | use crate::decoder::jbig2::{Jbig2Decoder, Jbig2GlobalsRef}; + | ^^^^^^^^^^^^^^^ + +warning: unused import: `crate::parser::object::intern` + --> crates/pdftract-core/src/parser/xref.rs:3672:13 + | +3672 | use crate::parser::object::intern; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `std::fs` + --> crates/pdftract-core/src/source/mmap.rs:178:9 + | +178 | use std::fs; + | ^^^^^^^ + +warning: unused import: `super::*` + --> crates/pdftract-core/src/sdk.rs:341:9 + | +341 | use super::*; + | ^^^^^^^^ + +warning: unused import: `crate::font::UnicodeSource` + --> crates/pdftract-core/src/span/mod.rs:1279:13 + | +1279 | use crate::font::UnicodeSource; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `crate::table::Segment` + --> crates/pdftract-core/src/table/output.rs:275:9 + | +275 | use crate::table::Segment; + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `crate::parser::stream::PdfSource` + --> crates/pdftract-core/src/sdk.rs:15:5 + | +15 | use crate::parser::stream::PdfSource as ParserPdfSource; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `Write` + --> crates/pdftract-core/src/atomic_file_writer.rs:191:33 + | +191 | use std::io::{self, Write}; + | ^^^^^ + +warning: unused import: `std::io::Read` + --> crates/pdftract-core/src/parser/stream.rs:12:5 + | +12 | use std::io::Read; + | ^^^^^^^^^^^^^ + +warning: unused import: `PdfSource` + --> crates/pdftract-core/src/document.rs:25:33 + | +25 | use crate::source::{FileSource, PdfSource}; + | ^^^^^^^^^ + +warning: unused import: `rayon::prelude` + --> crates/pdftract-core/src/extract.rs:62:5 + | +62 | use rayon::prelude::*; + | ^^^^^^^^^^^^^^ + +warning: unused import: `std::io::Write` + --> crates/pdftract-core/src/extract.rs:1656:9 + | +1656 | use std::io::Write; + | ^^^^^^^^^^^^^^ + +warning: unused import: `LineMetadata` + --> crates/pdftract-core/src/layout/correction.rs:20:40 + | +20 | use crate::layout::line::{Block, Line, LineMetadata}; + | ^^^^^^^^^^^^ + +warning: unused variable: `page_ref_to_index` + --> crates/pdftract-core/src/annotation/json.rs:29:5 + | +29 | page_ref_to_index: &Option>, + | ^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_page_ref_to_index` + | + = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/attachment/filespec.rs:156:9 + | +156 | let mut diagnostics = Vec::new(); + | ----^^^^^^^^^^^ + | | + | help: remove this `mut` + | + = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/cache/compression.rs:131:13 + | +131 | let mut decoder = zstd::Decoder::new(data)?; + | ----^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/cache/compression.rs:255:9 + | +255 | let mut decoder = zstd::Decoder::new(data)?; + | ----^^^^^^^ + | | + | help: remove this `mut` + +warning: unused variable: `ctx` + --> crates/pdftract-core/src/classify.rs:690:31 + | +690 | fn classify_hybrid(&self, ctx: &PageContext, cells: &[CellData; 64]) -> PageClassification { + | ^^^ help: if this is intentional, prefix it with an underscore: `_ctx` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/encryption/aes_128.rs:62:9 + | +62 | let mut hash = md5.finalize(); + | ----^^^^ + | | + | help: remove this `mut` + +warning: unused variable: `decrypted_len` + --> crates/pdftract-core/src/encryption/aes_256.rs:231:13 + | +231 | let decrypted_len = decryptor + | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_decrypted_len` + +warning: unused variable: `k` + --> crates/pdftract-core/src/encryption/rc4.rs:242:10 + | +242 | for (k, byte) in result.iter_mut().enumerate() { + | ^ help: if this is intentional, prefix it with an underscore: `_k` + +warning: unused variable: `padded_password` + --> crates/pdftract-core/src/encryption/rc4.rs:295:9 + | +295 | let padded_password = pad_password(password); + | ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_padded_password` + +warning: unused variable: `resolver` + --> crates/pdftract-core/src/extract.rs:158:5 + | +158 | resolver: &crate::parser::xref::XrefResolver, + | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_resolver` + +warning: unused variable: `page_index` + --> crates/pdftract-core/src/extract.rs:159:5 + | +159 | page_index: usize, + | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_page_index` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/extract.rs:676:9 + | +676 | let mut page_count = all_pages.len(); + | ----^^^^^^^^^^ + | | + | help: remove this `mut` + +warning: unused variable: `decryption_context` + --> crates/pdftract-core/src/extract.rs:569:9 + | +569 | let decryption_context = { + | ^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_decryption_context` + +warning: unused variable: `semaphore` + --> crates/pdftract-core/src/extract.rs:658:9 + | +658 | let semaphore = Arc::new(Semaphore::new(options.max_parallel_pages)); + | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_semaphore` + +warning: unused variable: `resolver` + --> crates/pdftract-core/src/extract.rs:1101:5 + | +1101 | resolver: &crate::parser::xref::XrefResolver, + | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_resolver` + +warning: unused variable: `catalog` + --> crates/pdftract-core/src/extract.rs:1102:5 + | +1102 | catalog: &crate::parser::catalog::Catalog, + | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_catalog` + +warning: unused variable: `kind` + --> crates/pdftract-core/src/extract.rs:1130:13 + | +1130 | kind, + | ^^^^ help: try ignoring the field: `kind: _` + +warning: unused variable: `is_combo` + --> crates/pdftract-core/src/extract.rs:1159:13 + | +1159 | is_combo, + | ^^^^^^^^ help: try ignoring the field: `is_combo: _` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/extract.rs:1734:9 + | +1734 | let mut page_count = 0usize; + | ----^^^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/extract.rs:1763:9 + | +1763 | let mut page_count = all_pages.len(); + | ----^^^^^^^^^^ + | | + | help: remove this `mut` + +warning: unused variable: `page_count` + --> crates/pdftract-core/src/extract.rs:1734:9 + | +1734 | let mut page_count = 0usize; + | ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_page_count` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/extract.rs:2357:9 + | +2357 | let mut spans = merge_glyphs_to_spans(&glyphs); + | ----^^^^^ + | | + | help: remove this `mut` + +warning: unused variable: `expected_type` + --> crates/pdftract-core/src/font/embedded.rs:345:26 + | +345 | let (stream_key, expected_type) = match kind { + | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_expected_type` + +warning: unused variable: `glyph_name_for_l4` + --> crates/pdftract-core/src/font/resolver.rs:551:9 + | +551 | let glyph_name_for_l4 = encoding.glyph_name_for(char_code); + | ^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_glyph_name_for_l4` + +warning: unused variable: `name` + --> crates/pdftract-core/src/font/type3_rasterizer.rs:500:13 + | +500 | let name = name_stack.pop().unwrap(); + | ^^^^ help: if this is intentional, prefix it with an underscore: `_name` + +warning: unused variable: `diagnostics` + --> crates/pdftract-core/src/forms/mod.rs:552:5 + | +552 | diagnostics: &mut Vec, + | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_diagnostics` + +warning: unused variable: `font_dict` + --> crates/pdftract-core/src/glyph/mod.rs:459:22 + | +459 | fn get_type0_advance(font_dict: &PdfDict, char_code: u32) -> u16 { + | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_font_dict` + +warning: unused variable: `char_code` + --> crates/pdftract-core/src/glyph/mod.rs:459:43 + | +459 | fn get_type0_advance(font_dict: &PdfDict, char_code: u32) -> u16 { + | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_char_code` + +warning: unused variable: `char_code` + --> crates/pdftract-core/src/glyph/mod.rs:519:45 + | +519 | fn get_font_glyph_bbox(font_dict: &PdfDict, char_code: u32) -> [f64; 4] { + | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_char_code` + +warning: unused variable: `descriptor_ref` + --> crates/pdftract-core/src/glyph/mod.rs:559:40 + | +559 | if let Some(PdfObject::Ref(descriptor_ref)) = font_dict.get("/FontDescriptor") { + | ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_descriptor_ref` + +warning: unreachable pattern + --> crates/pdftract-core/src/layout/correction.rs:376:13 + | +362 | 0x0178 => 0x8E, // Ÿ (Latin capital letter Y with diaeresis) + | ------ matches all the relevant values +... +376 | 0x0178 => 0x9E, // Ÿ (Latin small letter y with diaeresis) - duplicate codepoint, 9F is correct + | ^^^^^^ no value can reach this + | + = note: `#[warn(unreachable_patterns)]` (part of `#[warn(unused)]`) on by default + +warning: unused variable: `original_text` + --> crates/pdftract-core/src/layout/correction.rs:904:9 + | +904 | let original_text = span.text.clone(); + | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_original_text` + +warning: unused variable: `char_idx` + --> crates/pdftract-core/src/layout/correction.rs:921:10 + | +921 | for (char_idx, &ch) in chars.iter().enumerate() { + | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_char_idx` + +warning: unused variable: `x0` + --> crates/pdftract-core/src/layout/header_footer.rs:203:10 + | +203 | let [x0, y0, x1, y1] = block.bbox; + | ^^ help: if this is intentional, prefix it with an underscore: `_x0` + +warning: unused variable: `x1` + --> crates/pdftract-core/src/layout/header_footer.rs:203:18 + | +203 | let [x0, y0, x1, y1] = block.bbox; + | ^^ help: if this is intentional, prefix it with an underscore: `_x1` + +warning: unused variable: `avg_x0` + --> crates/pdftract-core/src/layout/line.rs:395:5 + | +395 | avg_x0: f32, + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_avg_x0` + +warning: value assigned to `region_count` is never read + --> crates/pdftract-core/src/layout/reading_order.rs:112:28 + | +112 | let mut region_count = 0; + | ^ this value is reassigned later and never used +... +119 | region_count = stats.region_count; + | --------------------------------- `region_count` is overwritten here before the previous value is read + | + = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default + +warning: value assigned to `small_region_count` is never read + --> crates/pdftract-core/src/layout/reading_order.rs:113:34 + | +113 | let mut small_region_count = 0; + | ^ this value is reassigned later and never used +... +120 | small_region_count = stats.small_region_count; + | --------------------------------------------- `small_region_count` is overwritten here before the previous value is read + +warning: unused variable: `x_split` + --> crates/pdftract-core/src/layout/reading_order.rs:190:18 + | +190 | if let Some((x_split, left_indices, right_indices)) = + | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_x_split` + +warning: unused variable: `y_split` + --> crates/pdftract-core/src/layout/reading_order.rs:211:18 + | +211 | if let Some((y_split, top_indices, bottom_indices)) = + | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_y_split` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/parser/inline_image.rs:668:29 + | +668 | let mut dict = Vec::new(); + | ----^^^^ + | | + | help: remove this `mut` + +warning: variable `sign_count` is assigned to, but never used + --> crates/pdftract-core/src/parser/lexer/mod.rs:528:13 + | +528 | let mut sign_count = 0; + | ^^^^^^^^^^^^^^ + | + = note: consider using `_sign_count` instead + +warning: value assigned to `sign_count` is never read + --> crates/pdftract-core/src/parser/lexer/mod.rs:537:13 + | +537 | sign_count = 1; + | ^^^^^^^^^^^^^^ + | + = help: maybe it is overwritten before being read? + +warning: unused variable: `diagnostics` + --> crates/pdftract-core/src/parser/ocg.rs:144:31 + | +144 | fn parse(obj: &PdfObject, diagnostics: &mut Vec) -> Self { + | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_diagnostics` + +warning: value assigned to `inherited` is never read + --> crates/pdftract-core/src/parser/pages.rs:1588:25 + | +1588 | inherited = parent_inherited; + | ^^^^^^^^^ + | + = help: maybe it is overwritten before being read? + +warning: value assigned to `inherited` is never read + --> crates/pdftract-core/src/parser/pages.rs:1569:41 + | +1569 | ... inherited = parent_inherited; + | ^^^^^^^^^ + | + = help: maybe it is overwritten before being read? + +warning: value assigned to `inherited` is never read + --> crates/pdftract-core/src/parser/pages.rs:1557:37 + | +1557 | ... inherited = parent_inherited; + | ^^^^^^^^^ + | + = help: maybe it is overwritten before being read? + +warning: value assigned to `inherited` is never read + --> crates/pdftract-core/src/parser/pages.rs:1580:33 + | +1580 | ... inherited = parent_inherited; + | ^^^^^^^^^ + | + = help: maybe it is overwritten before being read? + +warning: value assigned to `inherited` is never read + --> crates/pdftract-core/src/parser/pages.rs:1521:29 + | +1521 | ... inherited = parent_inherited; + | ^^^^^^^^^ + | + = help: maybe it is overwritten before being read? + +warning: value assigned to `inherited` is never read + --> crates/pdftract-core/src/parser/pages.rs:1512:29 + | +1512 | ... inherited = parent_inherited; + | ^^^^^^^^^ + | + = help: maybe it is overwritten before being read? + +warning: value assigned to `inherited` is never read + --> crates/pdftract-core/src/parser/pages.rs:1593:21 + | +1593 | inherited = parent_inherited; + | ^^^^^^^^^ + | + = help: maybe it is overwritten before being read? + +warning: unused variable: `buf` + --> crates/pdftract-core/src/parser/stream.rs:3477:24 + | +3477 | fn read(&mut self, buf: &mut [u8]) -> std::io::Result { + | ^^^ help: if this is intentional, prefix it with an underscore: `_buf` + +warning: unused variable: `e` + --> crates/pdftract-core/src/parser/stream.rs:3959:25 + | +3959 | Err(e) => { + | ^ help: if this is intentional, prefix it with an underscore: `_e` + +warning: unused variable: `std_type` + --> crates/pdftract-core/src/parser/struct_tree.rs:1654:20 + | +1654 | pub fn is_artifact(std_type: StructureType) -> bool { + | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_std_type` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/parser/xref.rs:826:41 + | +826 | fn read_line_at(source: &dyn PdfSource, mut pos: u64) -> Option { + | ----^^^ + | | + | help: remove this `mut` + +warning: unused variable: `diagnostics` + --> crates/pdftract-core/src/parser/xref.rs:876:53 + | +876 | fn read_line(source: &dyn PdfSource, pos: &mut u64, diagnostics: &mut Vec) -> Option { + | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_diagnostics` + +warning: value assigned to `depth` is never read + --> crates/pdftract-core/src/parser/xref.rs:909:21 + | +909 | let mut depth = 0; + | ^ this value is reassigned later and never used +... +938 | depth = 1; + | --------- `depth` is overwritten here before the previous value is read + +warning: unused variable: `source_len` + --> crates/pdftract-core/src/parser/xref.rs:1229:37 + | +1229 | fn forward_scan_memory(data: &[u8], source_len: u64) -> XrefSection { + | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_source_len` + +warning: unused variable: `prev` + --> crates/pdftract-core/src/semaphore.rs:65:13 + | +65 | let prev = self.permits.fetch_add(1, Ordering::Release); + | ^^^^ help: if this is intentional, prefix it with an underscore: `_prev` + +warning: unused variable: `col_count` + --> crates/pdftract-core/src/table/cell.rs:495:5 + | +495 | col_count: usize, + | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_col_count` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/table/grid.rs:52:9 + | +52 | mut intersections: Vec<(f32, f32)>, + | ----^^^^^^^^^^^^^ + | | + | help: remove this `mut` + +warning: unused variable: `page_idx` + --> crates/pdftract-core/src/table/output.rs:192:10 + | +192 | for (page_idx, page_tables) in all_tables.iter().enumerate() { + | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_page_idx` + +warning: unused variable: `current_page_height` + --> crates/pdftract-core/src/table/output.rs:203:13 + | +203 | let current_page_height = page_heights.get(page_idx).copied().unwrap_or(792.0); + | ^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_current_page_height` + +warning: unused variable: `other` + --> crates/pdftract-core/src/threads/mod.rs:361:19 + | +361 | (Some(other), _) => { + | ^^^^^ help: if this is intentional, prefix it with an underscore: `_other` + +warning: unused variable: `current_ref` + --> crates/pdftract-core/src/threads/mod.rs:535:43 + | +535 | fn extract_bead_rect(bead_dict: &PdfDict, current_ref: ObjRef) -> Option<[f32; 4]> { + | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_current_ref` + +warning: function `extract_destination_name` is never used + --> crates/pdftract-core/src/annotation/links.rs:491:4 + | +491 | fn extract_destination_name(dest_obj: Option<&PdfObject>) -> Option { + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default + +warning: function `canonical_json` is never used + --> crates/pdftract-core/src/cache/key.rs:127:4 + | +127 | fn canonical_json(value: &Value) -> String { + | ^^^^^^^^^^^^^^ + +warning: function `canonical_json_value` is never used + --> crates/pdftract-core/src/cache/key.rs:145:4 + | +145 | fn canonical_json_value(value: &Value) -> Value { + | ^^^^^^^^^^^^^^^^^^^^ + +warning: method `name` is never used + --> crates/pdftract-core/src/classify.rs:275:8 + | +268 | trait SignalEvaluator: Send + Sync { + | --------------- method in this trait +... +275 | fn name(&self) -> &'static str; + | ^^^^ + +warning: field `rotation` is never read + --> crates/pdftract-core/src/classify.rs:1202:5 + | +1196 | pub struct GridClassifier { + | -------------- field in this struct +... +1202 | rotation: i32, + | ^^^^^^^^ + +warning: field `0` is never read + --> crates/pdftract-core/src/cmap/codespace.rs:644:16 + | +644 | Unexpected(u8), + | ---------- ^^ + | | + | field in this variant + | + = note: `Token` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis +help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field + | +644 - Unexpected(u8), +644 + Unexpected(()), + | + +warning: method `depth` is never used + --> crates/pdftract-core/src/content_stream.rs:200:8 + | +153 | impl ExecutionContext { + | --------------------- method in this implementation +... +200 | fn depth(&self) -> usize { + | ^^^^^ + +warning: variants `Stream` and `Error` are never constructed + --> crates/pdftract-core/src/content_stream.rs:1609:5 + | +1608 | enum XObjectResolveResult { + | -------------------- variants in this enum +1609 | Stream(PdfDict, Vec), + | ^^^^^^ +1610 | Error(Diagnostic), + | ^^^^^ + +warning: field `source` is never read + --> crates/pdftract-core/src/document.rs:949:5 + | +941 | pub struct PageIter<'a> { + | -------- field in this struct +... +949 | source: Option<&'a dyn ParserPdfSource>, + | ^^^^^^ + +warning: field `page_height` is never read + --> crates/pdftract-core/src/extract.rs:371:9 + | +357 | struct PageResultInternal { + | ------------------ field in this struct +... +371 | pub page_height: f64, + | ^^^^^^^^^^^ + | + = note: `PageResultInternal` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis + +warning: function `extract_page` is never used + --> crates/pdftract-core/src/extract.rs:1315:4 + | +1315 | fn extract_page( + | ^^^^^^^^^^^^ + +warning: field `has_valid_encoding` is never read + --> crates/pdftract-core/src/font/embedded.rs:202:5 + | +194 | pub struct Type1Metrics { + | ------------ field in this struct +... +202 | has_valid_encoding: bool, + | ^^^^^^^^^^^^^^^^^^ + +warning: constant `MAX_GLYPH_DEPTH` is never used + --> crates/pdftract-core/src/font/type3_rasterizer.rs:27:7 + | +27 | const MAX_GLYPH_DEPTH: usize = 20; + | ^^^^^^^^^^^^^^^ + +warning: enum `PathCommand` is never used + --> crates/pdftract-core/src/font/type3_rasterizer.rs:121:6 + | +121 | enum PathCommand { + | ^^^^^^^^^^^ + +warning: struct `CurrentPath` is never constructed + --> crates/pdftract-core/src/font/type3_rasterizer.rs:140:8 + | +140 | struct CurrentPath { + | ^^^^^^^^^^^ + +warning: multiple associated items are never used + --> crates/pdftract-core/src/font/type3_rasterizer.rs:147:12 + | +146 | impl CurrentPath { + | ---------------- associated items in this implementation +147 | pub fn new() -> Self { + | ^^^ +... +151 | pub fn move_to(&mut self, p: Point) { + | ^^^^^^^ +... +157 | pub fn line_to(&mut self, p: Point) { + | ^^^^^^^ +... +162 | pub fn cubic_to(&mut self, c1: Point, c2: Point, end: Point) { + | ^^^^^^^^ +... +167 | pub fn shorthand_cubic_to(&mut self, c2: Point, end: Point) { + | ^^^^^^^^^^^^^^^^^^ +... +172 | pub fn shorthand_cubic_to_y(&mut self, c1: Point, end: Point) { + | ^^^^^^^^^^^^^^^^^^^^ +... +177 | pub fn rect(&mut self, x: f64, y: f64, width: f64, height: f64) { + | ^^^^ +... +183 | pub fn close_path(&mut self) { + | ^^^^^^^^^^ +... +190 | pub fn clear(&mut self) { + | ^^^^^ + +warning: struct `RasterizerContext` is never constructed + --> crates/pdftract-core/src/font/type3_rasterizer.rs:198:8 + | +198 | struct RasterizerContext<'a> { + | ^^^^^^^^^^^^^^^^^ + +warning: multiple associated items are never used + --> crates/pdftract-core/src/font/type3_rasterizer.rs:216:8 + | +215 | impl<'a> RasterizerContext<'a> { + | ------------------------------ associated items in this implementation +216 | fn new(font: &'a Type3Font) -> Self { + | ^^^ +... +229 | fn execute_content_stream(&mut self, stream_bytes: &[u8]) { + | ^^^^^^^^^^^^^^^^^^^^^^ +... +255 | fn execute_operator( + | ^^^^^^^^^^^^^^^^ +... +296 | fn op_move_to(&mut self, stack: &mut Vec) { + | ^^^^^^^^^^ +... +306 | fn op_line_to(&mut self, stack: &mut Vec) { + | ^^^^^^^^^^ +... +316 | fn op_cubic_to(&mut self, stack: &mut Vec) { + | ^^^^^^^^^^^ +... +331 | fn op_shorthand_cubic_to(&mut self, stack: &mut Vec) { + | ^^^^^^^^^^^^^^^^^^^^^ +... +344 | fn op_shorthand_cubic_to_y(&mut self, stack: &mut Vec) { + | ^^^^^^^^^^^^^^^^^^^^^^^ +... +357 | fn op_rect(&mut self, stack: &mut Vec) { + | ^^^^^^^ +... +369 | fn op_close_path(&mut self) { + | ^^^^^^^^^^^^^ +... +374 | fn op_no_op(&mut self) { + | ^^^^^^^^ +... +379 | fn op_stroke(&mut self) { + | ^^^^^^^^^ +... +385 | fn op_close_stroke(&mut self) { + | ^^^^^^^^^^^^^^^ +... +392 | fn op_fill(&mut self) { + | ^^^^^^^ +... +398 | fn op_eofill(&mut self) { + | ^^^^^^^^^ +... +405 | fn op_fill_stroke(&mut self) { + | ^^^^^^^^^^^^^^ +... +412 | fn op_eofill_stroke(&mut self) { + | ^^^^^^^^^^^^^^^^ +... +419 | fn op_close_fill_stroke(&mut self) { + | ^^^^^^^^^^^^^^^^^^^^ +... +427 | fn op_close_eofill_stroke(&mut self) { + | ^^^^^^^^^^^^^^^^^^^^^^ +... +435 | fn op_save(&mut self) { + | ^^^^^^^ +... +445 | fn op_restore(&mut self) { + | ^^^^^^^^^^ +... +457 | fn op_concat(&mut self, stack: &mut Vec) { + | ^^^^^^^^^ +... +496 | fn op_do(&mut self, name_stack: &mut Vec>) { + | ^^^^^ +... +519 | fn rasterize_path(&mut self, _stroke: bool) { + | ^^^^^^^^^^^^^^ + +warning: associated function `is_component` is never used + --> crates/pdftract-core/src/layout/correction.rs:838:8 + | +825 | impl Ligature { + | ------------- associated function in this implementation +... +838 | fn is_component(c: char) -> bool { + | ^^^^^^^^^^^^ + +warning: function `is_repeated_header_footer` is never used + --> crates/pdftract-core/src/layout/header_footer.rs:225:4 + | +225 | fn is_repeated_header_footer( + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: constant `REGION_COUNT_THRESHOLD` is never used + --> crates/pdftract-core/src/layout/reading_order.rs:27:7 + | +27 | const REGION_COUNT_THRESHOLD: usize = 10; + | ^^^^^^^^^^^^^^^^^^^^^^ + +warning: function `union_bboxes` is never used + --> crates/pdftract-core/src/layout/reading_order.rs:567:4 + | +567 | fn union_bboxes(blocks: &[B]) -> [f32; 4] + | ^^^^^^^^^^^^ + +warning: fields `distance` and `angle` are never read + --> crates/pdftract-core/src/layout/reading_order.rs:720:5 + | +714 | struct Edge { + | ---- fields in this struct +... +720 | distance: f32, + | ^^^^^^^^ +721 | /// Angle in radians between centers. +722 | angle: f32, + | ^^^^^ + | + = note: `Edge` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis + +warning: method `emit_diagnostic` is never used + --> crates/pdftract-core/src/parser/catalog.rs:421:8 + | +399 | impl Catalog { + | ------------ method in this implementation +... +421 | fn emit_diagnostic(&mut self, code: DiagCode, message: String) { + | ^^^^^^^^^^^^^^^ + +warning: method `has_bits` is never used + --> crates/pdftract-core/src/parser/hint_stream.rs:165:8 + | +112 | impl BitReader { + | -------------- method in this implementation +... +165 | fn has_bits(&self, n: usize) -> bool { + | ^^^^^^^^ + +warning: fields `shared_object_number_bits`, `shared_group_length_bits`, and `shared_group_count` are never read + --> crates/pdftract-core/src/parser/hint_stream.rs:180:5 + | +172 | struct HintHeader { + | ---------- fields in this struct +... +180 | shared_object_number_bits: u8, + | ^^^^^^^^^^^^^^^^^^^^^^^^^ +181 | /// Bit width for shared object hint group lengths +182 | shared_group_length_bits: u8, + | ^^^^^^^^^^^^^^^^^^^^^^^^ +... +186 | shared_group_count: u32, + | ^^^^^^^^^^^^^^^^^^ + | + = note: `HintHeader` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis + +warning: method `lex_unknown` is never used + --> crates/pdftract-core/src/parser/lexer/mod.rs:1108:8 + | + 117 | impl<'a> Lexer<'a> { + | ------------------ method in this implementation +... +1108 | fn lex_unknown(&mut self) -> Option { + | ^^^^^^^^^^^ + +warning: method `emit_diagnostic` is never used + --> crates/pdftract-core/src/parser/marked_content.rs:83:8 + | +41 | impl McidTracker { + | ---------------- method in this implementation +... +83 | fn emit_diagnostic(&mut self, code: DiagCode, message: String) { + | ^^^^^^^^^^^^^^^ + +warning: associated function `from_name` is never used + --> crates/pdftract-core/src/parser/ocg.rs:69:8 + | +67 | impl OcmdPolicy { + | --------------- associated function in this implementation +68 | /// Parse a policy from a name object. +69 | fn from_name(name: &str) -> Option { + | ^^^^^^^^^ + +warning: associated function `parse` is never used + --> crates/pdftract-core/src/parser/ocg.rs:99:8 + | +92 | impl Ocmd { + | --------- associated function in this implementation +... +99 | fn parse(obj: &PdfObject) -> Option { + | ^^^^^ + +warning: function `read_line` is never used + --> crates/pdftract-core/src/parser/xref.rs:876:4 + | +876 | fn read_line(source: &dyn PdfSource, pos: &mut u64, diagnostics: &mut Vec) -> Option { + | ^^^^^^^^^ + +warning: function `round_coord` is never used + --> crates/pdftract-core/src/receipts/ocr_fallback.rs:239:4 + | +239 | fn round_coord(value: f64) -> f64 { + | ^^^^^^^^^^^ + +warning: function `get_block_text` is never used + --> crates/pdftract-core/src/text.rs:329:4 + | +329 | fn get_block_text(block: &BlockJson) -> String { + | ^^^^^^^^^^^^^^ + +warning: field `font_id` is never read + --> crates/pdftract-core/src/word_boundary.rs:39:5 + | +37 | pub struct WordBoundaryDetector { + | -------------------- field in this struct +38 | /// Font identifier for this detector. +39 | font_id: FontId, + | ^^^^^^^ + | + = note: `WordBoundaryDetector` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis + +warning: static variable `HASH_56a45233d29f11b4dfb86d248e921939d115778f87325e7ae8cc108383d6664d` should have an upper case name + --> /home/coding/pdftract/target/debug/build/pdftract-core-0d428a00850f9797/out/font_fingerprints.rs:7:8 + | +7 | static HASH_56a45233d29f11b4dfb86d248e921939d115778f87325e7ae8cc108383d6664d: &[(u16, u32)] = &[(1, 32), (2, 33), (3, 34), (4, 35), (... + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(non_upper_case_globals)]` (part of `#[warn(nonstandard_style)]`) on by default +help: convert the identifier to upper case + | +7 - static HASH_56a45233d29f11b4dfb86d248e921939d115778f87325e7ae8cc108383d6664d: &[(u16, u32)] = &[(1, 32), (2, 33), (3, 34), (4, 35), (5, 36), (6, 37), (7, 38), (8, 39), (9, 40), (10, 41), (11, 42), (12, 43), (13, 44), (14, 45), (15, 46), (16, 47), (17, 48), (18, 49), (19, 50), (20, 51), (21, 52), (22, 53), (23, 54), (24, 55), (25, 56), (26, 57), (27, 58), (28, 59), (29, 60), (30, 61), (31, 62), (32, 63), (33, 64), (34, 65), (35, 66), (36, 67), (37, 68), (38, 69), (39, 70), (40, 71), (41, 72), (42, 73), (43, 74), (44, 75), (45, 76), (46, 77), (47, 78), (48, 79), (49, 80), (50, 81), (51, 82), (52, 83), (53, 84), (54, 85), (55, 86), (56, 87), (57, 88), (58, 89), (59, 90), (60, 91), (61, 92), (62, 93), (63, 94), (64, 95), (65, 96), (66, 97), (67, 98), (68, 99), (69, 100), (70, 101), (71, 102), (72, 103), (73, 104), (74, 105), (75, 106), (76, 107), (77, 108), (78, 109), (79, 110), (80, 111), (81, 112), (82, 113), (83, 114), (84, 115), (85, 116), (86, 117), (87, 118), (88, 119), (89, 120), (90, 121), (91, 122), (92, 123), (93, 124), (94, 125), (95, 126)]; +7 + static HASH_56A45233D29F11B4DFB86D248E921939D115778F87325E7AE8CC108383D6664D: &[(u16, u32)] = &[(1, 32), (2, 33), (3, 34), (4, 35), (5, 36), (6, 37), (7, 38), (8, 39), (9, 40), (10, 41), (11, 42), (12, 43), (13, 44), (14, 45), (15, 46), (16, 47), (17, 48), (18, 49), (19, 50), (20, 51), (21, 52), (22, 53), (23, 54), (24, 55), (25, 56), (26, 57), (27, 58), (28, 59), (29, 60), (30, 61), (31, 62), (32, 63), (33, 64), (34, 65), (35, 66), (36, 67), (37, 68), (38, 69), (39, 70), (40, 71), (41, 72), (42, 73), (43, 74), (44, 75), (45, 76), (46, 77), (47, 78), (48, 79), (49, 80), (50, 81), (51, 82), (52, 83), (53, 84), (54, 85), (55, 86), (56, 87), (57, 88), (58, 89), (59, 90), (60, 91), (61, 92), (62, 93), (63, 94), (64, 95), (65, 96), (66, 97), (67, 98), (68, 99), (69, 100), (70, 101), (71, 102), (72, 103), (73, 104), (74, 105), (75, 106), (76, 107), (77, 108), (78, 109), (79, 110), (80, 111), (81, 112), (82, 113), (83, 114), (84, 115), (85, 116), (86, 117), (87, 118), (88, 119), (89, 120), (90, 121), (91, 122), (92, 123), (93, 124), (94, 125), (95, 126)]; + | + +warning: hiding a lifetime that's elided elsewhere is confusing + --> crates/pdftract-core/src/layout/readability.rs:244:13 + | +244 | fn text(&self) -> Cow; + | ^^^^^ ^^^^^^^^ the same lifetime is hidden here + | | + | the lifetime is elided here + | + = help: the same lifetime is referred to in inconsistent ways, making the signature confusing + = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default +help: use `'_` for type paths + | +244 | fn text(&self) -> Cow<'_, str>; + | +++ + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/atomic_file_writer.rs:295:13 + | +295 | for mut writer in writers { + | ----^^^^^^ + | | + | help: remove this `mut` + | + = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/attachment/filespec.rs:156:9 + | +156 | let mut diagnostics = Vec::new(); + | ----^^^^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/attachment/filespec.rs:598:13 + | +598 | let mut uf_bytes = filename + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/attachment/name_tree.rs:473:13 + | +473 | let mut names_dict = IndexMap::new(); + | ----^^^^^^^^^^ + | | + | help: remove this `mut` + +warning: unused variable: `classifier` + --> crates/pdftract-core/src/classify.rs:2121:13 + | +2121 | let classifier = PageClassifier::default(); + | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_classifier` + +warning: unused variable: `classifier` + --> crates/pdftract-core/src/classify.rs:2145:13 + | +2145 | let classifier = PageClassifier::default(); + | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_classifier` + +warning: unused variable: `classifier` + --> crates/pdftract-core/src/classify.rs:2166:13 + | +2166 | let classifier = PageClassifier::default(); + | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_classifier` + +warning: unused variable: `ranges` + --> crates/pdftract-core/src/cmap/codespace.rs:827:14 + | +827 | let (ranges, diags) = parser.parse(); + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_ranges` + +warning: unused variable: `input` + --> crates/pdftract-core/src/cmap/codespace.rs:884:13 + | +884 | let input = b"1 begincodespacerace <00> <7F> endcodespacerace"; + | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` + +warning: unused variable: `catalog` + --> crates/pdftract-core/src/document.rs:1183:27 + | +1183 | let (fingerprint, catalog, pages, resolver) = parse_pdf_file(&pdf_path).unwrap(); + | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_catalog` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/encryption/aes_128.rs:221:13 + | +221 | let mut data = vec![0u8; 33]; + | ----^^^^ + | | + | help: remove this `mut` + +warning: unused variable: `deferred_diag` + --> crates/pdftract-core/src/extract.rs:3033:13 + | +3033 | let deferred_diag = result + | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_deferred_diag` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/font/encoding.rs:1195:13 + | +1195 | let mut diagnostics: Vec = Vec::new(); + | ----^^^^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/forms/mod.rs:840:13 + | +840 | let mut resolver = XrefResolver::new(); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/forms/mod.rs:931:13 + | +931 | let mut resolver = XrefResolver::new(); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/forms/mod.rs:992:14 + | +992 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/forms/mod.rs:992:27 + | +992 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/forms/mod.rs:1065:14 + | +1065 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/forms/mod.rs:1065:27 + | +1065 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/forms/mod.rs:1112:14 + | +1112 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/forms/mod.rs:1112:27 + | +1112 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/forms/mod.rs:1154:14 + | +1154 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/forms/mod.rs:1154:27 + | +1154 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/forms/mod.rs:1196:14 + | +1196 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/forms/mod.rs:1196:27 + | +1196 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/forms/mod.rs:1238:14 + | +1238 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/forms/mod.rs:1238:27 + | +1238 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/forms/mod.rs:1276:14 + | +1276 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/forms/mod.rs:1276:27 + | +1276 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/forms/mod.rs:1352:14 + | +1352 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/forms/mod.rs:1352:27 + | +1352 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: unused variable: `initial_ctm` + --> crates/pdftract-core/src/graphics_state.rs:1094:13 + | +1094 | let initial_ctm = state.ctm; + | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_initial_ctm` + +warning: unused variable: `threshold` + --> crates/pdftract-core/src/layout/columns.rs:1041:13 + | +1041 | let threshold = (page_width * 0.03_f32).ceil() as usize; // 9 + | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_threshold` + +warning: unused variable: `threshold` + --> crates/pdftract-core/src/layout/columns.rs:1060:13 + | +1060 | let threshold = (page_width * 0.03_f32).ceil() as usize; // 18 + | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_threshold` + +warning: unused variable: `text_a` + --> crates/pdftract-core/src/layout/header_footer.rs:415:13 + | +415 | let text_a = "ACME Corporation XYZ"; + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_text_a` + +warning: unused variable: `text_b` + --> crates/pdftract-core/src/layout/header_footer.rs:416:13 + | +416 | let text_b = "ACME CorporationsXYZ"; // 1 char diff (added 's') + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_text_b` + +warning: unused variable: `text_a` + --> crates/pdftract-core/src/layout/header_footer.rs:433:13 + | +433 | let text_a = "ACME Corporation ".repeat(6); // ~114 chars + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_text_a` + +warning: unused variable: `text_b` + --> crates/pdftract-core/src/layout/header_footer.rs:434:13 + | +434 | let text_b = "ACME Corporation ".repeat(5).to_string() + "ACME Corporution "; // typo + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_text_b` + +warning: unused variable: `first_main` + --> crates/pdftract-core/src/layout/reading_order.rs:1167:23 + | +1167 | if let (Some(&first_main), Some(&last_main), Some(&first_sidebar)) = + | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_first_main` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/parser/lexer/mod.rs:1761:20 + | +1761 | .prop_map(|mut bytes| { + | ----^^^^^ + | | + | help: remove this `mut` + +warning: value assigned to `offset` is never read + --> crates/pdftract-core/src/parser/objstm.rs:724:9 + | +724 | offset += b"5 0 R\n".len() as u64; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: maybe it is overwritten before being read? + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/parser/objstm.rs:781:13 + | +781 | let mut dict = PdfDict::new(); + | ----^^^^ + | | + | help: remove this `mut` + +warning: unused variable: `has_bomb_diag` + --> crates/pdftract-core/src/parser/objstm.rs:1159:13 + | +1159 | let has_bomb_diag = diags.iter().any(|d| d.code == DiagCode::StreamBomb); + | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_has_bomb_diag` + +warning: unused variable: `obj_ref` + --> crates/pdftract-core/src/parser/ocg.rs:433:22 + | +433 | fn make_test_ocg(obj_ref: ObjRef, name: &str, intent: Option<&str>) -> PdfObject { + | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_obj_ref` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/parser/ocg.rs:493:13 + | +493 | let mut resolver = make_test_resolver(); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/parser/ocg.rs:530:13 + | +530 | let mut resolver = make_test_resolver(); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/parser/ocg.rs:563:13 + | +563 | let mut resolver = make_test_resolver(); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/parser/ocg.rs:607:13 + | +607 | let mut resolver = make_test_resolver(); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/parser/ocg.rs:644:13 + | +644 | let mut resolver = make_test_resolver(); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/parser/ocg.rs:680:13 + | +680 | let mut resolver = make_test_resolver(); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: unused variable: `resolver` + --> crates/pdftract-core/src/parser/ocg.rs:706:13 + | +706 | let resolver = make_test_resolver(); + | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_resolver` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/parser/ocg.rs:856:21 + | +856 | let mut resolver = make_test_resolver(); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: unused variable: `diags` + --> crates/pdftract-core/src/parser/outline.rs:1065:24 + | +1065 | let (outlines, diags) = parse_outlines(&resolver, Some(ObjRef::new(99, 0)), &pages); + | ^^^^^ help: if this is intentional, prefix it with an underscore: `_diags` + +warning: unused variable: `diags` + --> crates/pdftract-core/src/parser/outline.rs:1107:24 + | +1107 | let (outlines, diags) = parse_outlines(&resolver, Some(ObjRef::new(99, 0)), &pages); + | ^^^^^ help: if this is intentional, prefix it with an underscore: `_diags` + +warning: unused variable: `diags` + --> crates/pdftract-core/src/parser/outline.rs:1165:24 + | +1165 | let (outlines, diags) = parse_outlines(&resolver, Some(ObjRef::new(99, 0)), &pages); + | ^^^^^ help: if this is intentional, prefix it with an underscore: `_diags` + +warning: unused variable: `diags` + --> crates/pdftract-core/src/parser/outline.rs:1222:24 + | +1222 | let (outlines, diags) = parse_outlines(&resolver, Some(ObjRef::new(99, 0)), &pages); + | ^^^^^ help: if this is intentional, prefix it with an underscore: `_diags` + +warning: unused variable: `diags` + --> crates/pdftract-core/src/parser/outline.rs:1335:24 + | +1335 | let (outlines, diags) = parse_outlines(&resolver, Some(ObjRef::new(99, 0)), &pages); + | ^^^^^ help: if this is intentional, prefix it with an underscore: `_diags` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/parser/outline.rs:1434:13 + | +1434 | let mut root_dict = IndexMap::new(); + | ----^^^^^^^^^ + | | + | help: remove this `mut` + +warning: unused variable: `diags` + --> crates/pdftract-core/src/parser/outline.rs:1485:24 + | +1485 | let (outlines, diags) = parse_outlines(&resolver, Some(ObjRef::new(99, 0)), &pages); + | ^^^^^ help: if this is intentional, prefix it with an underscore: `_diags` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/parser/pages.rs:1340:13 + | +1340 | let mut root_resources = PdfDict::new(); // Empty resources dict + | ----^^^^^^^^^^^^^^ + | | + | help: remove this `mut` + +warning: unused variable: `max_depth` + --> crates/pdftract-core/src/parser/pages.rs:1706:40 + | +1706 | fn arb_pages_dict_with_direct_kids(max_depth: u8) -> impl Strategy { + | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_max_depth` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/parser/resources.rs:323:13 + | +323 | let mut ancestor = ResourceDict::new(); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/parser/xref.rs:4595:13 + | +4595 | let mut rev2_with_prev = rev2.to_vec(); + | ----^^^^^^^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/parser/xref.rs:4602:13 + | +4602 | let mut rev3_with_prev = rev3.to_vec(); + | ----^^^^^^^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/parser/xref.rs:4609:13 + | +4609 | let mut rev4_with_prev = rev4.to_vec(); + | ----^^^^^^^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/parser/xref.rs:4649:13 + | +4649 | let mut rev2_with_prev = rev2.to_vec(); + | ----^^^^^^^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/parser/xref.rs:4688:13 + | +4688 | let mut rev2_with_prev = rev2.to_vec(); + | ----^^^^^^^^^^^^^^ + | | + | help: remove this `mut` + +warning: unused variable: `rev_base` + --> crates/pdftract-core/src/parser/xref.rs:4720:13 + | +4720 | let rev_base = b"xref\n0 1\n\ + | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_rev_base` + +warning: unused variable: `rev1_offset` + --> crates/pdftract-core/src/parser/xref.rs:4840:13 + | +4840 | let rev1_offset = file_data.len() as u64; + | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_rev1_offset` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/parser/xref.rs:4931:13 + | +4931 | let mut rev2_with_prev = rev2_trad.to_vec(); + | ----^^^^^^^^^^^^^^ + | | + | help: remove this `mut` + +warning: unused variable: `has_prev` + --> crates/pdftract-core/src/parser/xref.rs:4970:51 + | +4970 | for (i, (obj_num, offset, gen_nr, has_prev)) in revisions.iter().enumerate() { + | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_has_prev` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/word_boundary.rs:440:13 + | +440 | let mut manager = WordBoundaryManager::new(); + | ----^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/signature/mod.rs:838:13 + | +838 | let mut resolver = XrefResolver::new(); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/signature/mod.rs:909:13 + | +909 | let mut resolver = XrefResolver::new(); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/signature/mod.rs:933:14 + | +933 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/signature/mod.rs:933:27 + | +933 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/signature/mod.rs:969:14 + | +969 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/signature/mod.rs:969:27 + | +969 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/signature/mod.rs:1002:14 + | +1002 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/signature/mod.rs:1002:27 + | +1002 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/signature/mod.rs:1045:14 + | +1045 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/signature/mod.rs:1045:27 + | +1045 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/signature/mod.rs:1070:14 + | +1070 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/signature/mod.rs:1070:27 + | +1070 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/signature/mod.rs:1088:14 + | +1088 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/signature/mod.rs:1088:27 + | +1088 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/signature/mod.rs:1108:14 + | +1108 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/signature/mod.rs:1108:27 + | +1108 | let (mut catalog, mut resolver) = make_test_acroform(fields); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/signature/mod.rs:1201:13 + | +1201 | let mut resolver = XrefResolver::new(); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: unused variable: `v_ref` + --> crates/pdftract-core/src/signature/mod.rs:1183:13 + | +1183 | let v_ref = ObjRef::new(500, 0); + | ^^^^^ help: if this is intentional, prefix it with an underscore: `_v_ref` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/signature/mod.rs:1259:13 + | +1259 | let mut resolver = XrefResolver::new(); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/signature/mod.rs:1315:13 + | +1315 | let mut resolver = XrefResolver::new(); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/signature/mod.rs:1401:13 + | +1401 | let mut resolver = XrefResolver::new(); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/signature/mod.rs:1429:13 + | +1429 | let mut resolver = XrefResolver::new(); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/signature/mod.rs:1457:13 + | +1457 | let mut resolver = XrefResolver::new(); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: variable does not need to be mutable + --> crates/pdftract-core/src/signature/mod.rs:1491:13 + | +1491 | let mut resolver = XrefResolver::new(); + | ----^^^^^^^^ + | | + | help: remove this `mut` + +warning: function `make_filespec` is never used + --> crates/pdftract-core/src/attachment/filespec.rs:587:8 + | +587 | fn make_filespec( + | ^^^^^^^^^^^^^ + +warning: function `make_ef_stream` is never used + --> crates/pdftract-core/src/attachment/filespec.rs:629:8 + | +629 | fn make_ef_stream( + | ^^^^^^^^^^^^^^ + +warning: constant `DECODER` is never used + --> crates/pdftract-core/src/decoder/jbig2.rs:221:15 + | +221 | const DECODER: Jbig2Decoder = Jbig2Decoder::new(); + | ^^^^^^^ + +warning: field `font` is never read + --> crates/pdftract-core/src/font/type3_rasterizer.rs:208:5 + | +198 | struct RasterizerContext<'a> { + | ----------------- field in this struct +... +208 | font: &'a Type3Font, + | ^^^^ + +warning: associated function `with_text` is never used + --> crates/pdftract-core/src/layout/line.rs:871:12 + | +860 | impl TestSpan { + | ------------- associated function in this implementation +... +871 | fn with_text(bbox: [f32; 4], font_size: f32, text: &str) -> Self { + | ^^^^^^^^^ + +warning: struct `TestBlock` is never constructed + --> crates/pdftract-core/src/layout/watermark_formula.rs:111:12 + | +111 | struct TestBlock { + | ^^^^^^^^^ + +warning: fields `shared_object_number_bits` and `shared_group_length_bits` are never read + --> crates/pdftract-core/src/parser/hint_stream.rs:180:5 + | +172 | struct HintHeader { + | ---------- fields in this struct +... +180 | shared_object_number_bits: u8, + | ^^^^^^^^^^^^^^^^^^^^^^^^^ +181 | /// Bit width for shared object hint group lengths +182 | shared_group_length_bits: u8, + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `HintHeader` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis + +warning: function `make_test_resolver` is never used + --> crates/pdftract-core/src/parser/struct_tree.rs:1754:8 + | +1754 | fn make_test_resolver() -> XrefResolver { + | ^^^^^^^^^^^^^^^^^^ + +warning: comparison is useless due to type limits + --> crates/pdftract-core/src/content_stream.rs:3112:17 + | +3112 | assert!(result.diagnostics.len() >= 0); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_comparisons)]` on by default + +warning: `pdftract-core` (lib) generated 184 warnings (run `cargo fix --lib -p pdftract-core` to apply 128 suggestions) +warning: unused import: `Diagnostic` + --> crates/pdftract-core/tests/encryption_integration_tests.rs:12:44 + | +12 | use pdftract_core::diagnostics::{DiagCode, Diagnostic}; + | ^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: unused imports: `CryptFilterMethod`, `DecryptionError`, `EncryptionInfo`, `FileKeyResult as Aes256FileKeyResult`, `FileKeyResult as Rc4FileKeyResult`, `PasswordValidation`, `aes_256_decrypt`, `decrypt_object`, `decrypt_with_password`, and `validate_user_password` + --> crates/pdftract-core/tests/encryption_integration_tests.rs:16:15 + | +16 | aes_256::{aes_256_decrypt, Aes256Decryptor, FileKeyResult as Aes256FileKeyResult}, + | ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17 | decryptor::{decrypt_with_password, DecryptionError, PasswordValidation}, + | ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ +18 | detection::{ +19 | detect_encryption, CryptFilterMethod, EncryptionInfo, + | ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ +... +23 | decrypt_object, derive_file_key, derive_object_key, pad_password, rc4_decrypt, + | ^^^^^^^^^^^^^^ +24 | validate_user_password, FileKeyResult as Rc4FileKeyResult, + | ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused imports: `XrefEntry` and `XrefResolver` + --> crates/pdftract-core/tests/encryption_integration_tests.rs:30:35 + | +30 | use pdftract_core::parser::xref::{XrefEntry, XrefResolver}; + | ^^^^^^^^^ ^^^^^^^^^^^^ + +warning: method `with_encrypt_dict` is never used + --> crates/pdftract-core/tests/encryption_integration_tests.rs:44:8 + | +39 | impl MockResolver { + | ----------------- method in this implementation +... +44 | fn with_encrypt_dict(mut self, dict: PdfDict) -> Self { + | ^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default + +warning: `pdftract-core` (test "encryption_integration_tests") generated 4 warnings (run `cargo fix --test "encryption_integration_tests" -p pdftract-core` to apply 3 suggestions) +warning: unused variable: `offset` + --> crates/pdftract-core/tests/hint_stream_integration.rs:428:26 + | +428 | fn read_range(&self, offset: u64, length: usize) -> std::io::Result { + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_offset` + | + = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default + +warning: unused variable: `length` + --> crates/pdftract-core/tests/hint_stream_integration.rs:428:39 + | +428 | fn read_range(&self, offset: u64, length: usize) -> std::io::Result { + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_length` + +warning: unused variable: `expected_ranges` + --> crates/pdftract-core/tests/hint_stream_integration.rs:445:21 + | +445 | let (hint_data, expected_ranges) = create_test_hint_stream(5); + | ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_expected_ranges` + +warning: struct `MockPrefetchSource` is never constructed + --> crates/pdftract-core/tests/hint_stream_integration.rs:394:8 + | +394 | struct MockPrefetchSource { + | ^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default + +warning: associated function `new` is never used + --> crates/pdftract-core/tests/hint_stream_integration.rs:403:8 + | +401 | impl MockPrefetchSource { + | ----------------------- associated function in this implementation +402 | /// Create a new mock source with the given hint stream data. +403 | fn new(hint_stream_data: Vec) -> Self { + | ^^^ + +warning: `pdftract-core` (test "hint_stream_integration") generated 5 warnings (run `cargo fix --test "hint_stream_integration" -p pdftract-core` to apply 3 suggestions) +warning: unused import: `Catalog` + --> crates/pdftract-core/tests/debug_page_parsing.rs:4:53 + | +4 | use pdftract_core::parser::catalog::{parse_catalog, Catalog}; + | ^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: `pdftract-core` (test "debug_page_parsing") generated 1 warning (run `cargo fix --test "debug_page_parsing" -p pdftract-core` to apply 1 suggestion) +warning: unused import: `PathBuf` + --> crates/pdftract-core/tests/xref_integration_test.rs:10:23 + | +10 | use std::path::{Path, PathBuf}; + | ^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: unused imports: `merge_hybrid`, `parse_traditional_xref`, and `parse_xref_stream` + --> crates/pdftract-core/tests/xref_integration_test.rs:16:5 + | +16 | merge_hybrid, parse_traditional_xref, parse_xref_stream, XrefEntry, XrefSection, + | ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ + +warning: function `assert_no_diagnostic_with_severity` is never used + --> crates/pdftract-core/tests/xref_helpers.rs:105:8 + | +105 | pub fn assert_no_diagnostic_with_severity( + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default + +warning: function `count_diagnostics` is never used + --> crates/pdftract-core/tests/xref_helpers.rs:131:8 + | +131 | pub fn count_diagnostics(diagnostics: &[Diagnostic], code: DiagCode) -> usize { + | ^^^^^^^^^^^^^^^^^ + +warning: `pdftract-core` (test "xref_integration_test") generated 4 warnings (run `cargo fix --test "xref_integration_test" -p pdftract-core` to apply 2 suggestions) +warning: unused variable: `v1_cat` + --> crates/pdftract-core/examples/test_fingerprint_debug.rs:8:17 + | +8 | let (v1_fp, v1_cat, v1_pages, _) = parse_pdf_file(v1_path).unwrap(); + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_v1_cat` + | + = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default + +warning: unused variable: `v2_cat` + --> crates/pdftract-core/examples/test_fingerprint_debug.rs:9:17 + | +9 | let (v2_fp, v2_cat, v2_pages, _) = parse_pdf_file(v2_path).unwrap(); + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_v2_cat` + +warning: `pdftract-core` (example "test_fingerprint_debug") generated 2 warnings (run `cargo fix --example "test_fingerprint_debug" -p pdftract-core` to apply 2 suggestions) +warning: function `format_validation_error` is never used + --> crates/pdftract-core/tests/json_schema.rs:47:4 + | +47 | fn format_validation_error(error: &jsonschema::ValidationError) -> String { + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default + +warning: `pdftract-core` (test "json_schema") generated 1 warning +warning: unused import: `std::collections::hash_map::DefaultHasher` + --> crates/pdftract-core/tests/test_cycle_detection.rs:131:9 + | +131 | use std::collections::hash_map::DefaultHasher; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: unused imports: `Hash` and `Hasher` + --> crates/pdftract-core/tests/test_cycle_detection.rs:132:21 + | +132 | use std::hash::{Hash, Hasher}; + | ^^^^ ^^^^^^ + +warning: `pdftract-core` (test "test_cycle_detection") generated 2 warnings (run `cargo fix --test "test_cycle_detection" -p pdftract-core` to apply 2 suggestions) +warning: unused imports: `ExtractionOptions` and `extract_pdf` + --> crates/pdftract-core/examples/ocr.rs:12:21 + | +12 | use pdftract_core::{extract_pdf, ExtractionOptions}; + | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: unused import: `std::env` + --> crates/pdftract-core/examples/ocr.rs:13:5 + | +13 | use std::env; + | ^^^^^^^^ + +warning: unused import: `std::path::Path` + --> crates/pdftract-core/examples/ocr.rs:14:5 + | +14 | use std::path::Path; + | ^^^^^^^^^^^^^^^ + +warning: `pdftract-core` (example "ocr") generated 3 warnings (run `cargo fix --example "ocr" -p pdftract-core` to apply 3 suggestions) +warning: unused variable: `error` + --> crates/pdftract-core/tests/schema_validate_fixtures.rs:100:13 + | +100 | Err(error) => { + | ^^^^^ help: if this is intentional, prefix it with an underscore: `_error` + | + = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default + +warning: `pdftract-core` (test "schema_validate_fixtures") generated 1 warning (run `cargo fix --test "schema_validate_fixtures" -p pdftract-core` to apply 1 suggestion) +warning: fields `name` and `description` are never read + --> crates/pdftract-core/tests/cjk_encoding.rs:17:5 + | +16 | struct CjkFixture { + | ---------- fields in this struct +17 | name: &'static str, + | ^^^^ +... +20 | description: &'static str, + | ^^^^^^^^^^^ + | + = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default + +warning: `pdftract-core` (test "cjk_encoding") generated 1 warning +warning: unused import: `Path` + --> crates/pdftract-core/tests/conformance.rs:19:17 + | +19 | use std::path::{Path, PathBuf}; + | ^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: unused import: `regex::Regex` + --> crates/pdftract-core/tests/conformance.rs:22:5 + | +22 | use regex::Regex; + | ^^^^^^^^^^^^ + +warning: variable does not need to be mutable + --> crates/pdftract-core/tests/conformance.rs:416:9 + | +416 | let mut result = serde_json::json!({ + | ----^^^^^^ + | | + | help: remove this `mut` + | + = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default + +warning: variable does not need to be mutable + --> crates/pdftract-core/tests/conformance.rs:454:9 + | +454 | let mut result = serde_json::json!({ + | ----^^^^^^ + | | + | help: remove this `mut` + +warning: field `min_schema_version` is never read + --> crates/pdftract-core/tests/conformance.rs:43:5 + | +33 | struct TestCase { + | -------- field in this struct +... +43 | min_schema_version: Option, + | ^^^^^^^^^^^^^^^^^^ + | + = note: `TestCase` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis + = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default + +warning: fields `version` and `schema_version` are never read + --> crates/pdftract-core/tests/conformance.rs:51:5 + | +50 | struct ConformanceSuite { + | ---------------- fields in this struct +51 | version: String, + | ^^^^^^^ +52 | schema_version: String, + | ^^^^^^^^^^^^^^ + | + = note: `ConformanceSuite` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis + +warning: `pdftract-core` (test "conformance") generated 6 warnings (run `cargo fix --test "conformance" -p pdftract-core` to apply 4 suggestions) +warning: unused variable: `cat1` + --> crates/pdftract-core/tests/debug_fingerprint_fixtures.rs:11:15 + | +11 | let (fp1, cat1, pages1, _resolver1) = parse_pdf_file(v1_path).unwrap(); + | ^^^^ help: if this is intentional, prefix it with an underscore: `_cat1` + | + = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default + +warning: unused variable: `cat2` + --> crates/pdftract-core/tests/debug_fingerprint_fixtures.rs:20:15 + | +20 | let (fp2, cat2, pages2, _resolver2) = parse_pdf_file(v2_path).unwrap(); + | ^^^^ help: if this is intentional, prefix it with an underscore: `_cat2` + +warning: `pdftract-core` (test "debug_fingerprint_fixtures") generated 2 warnings (run `cargo fix --test "debug_fingerprint_fixtures" -p pdftract-core` to apply 2 suggestions) +warning: unused doc comment + --> crates/pdftract-core/tests/encoding_recovery.rs:224:5 + | +224 | / /// Overall recovery rate for the entire corpus. +225 | | /// +226 | | /// The Phase 2 exit gate requires ≥90% recovery rate on this corpus. +227 | | /// This is calculated as the weighted average recovery across all fixtures. + | |________________________________________________________________________________^ +228 | let fixtures = get_fixtures(); + | ------------------------------ rustdoc does not generate documentation for statements + | + = help: use `//` for a plain comment + = note: `#[warn(unused_doc_comments)]` (part of `#[warn(unused)]`) on by default + +warning: field `description` is never read + --> crates/pdftract-core/tests/encoding_recovery.rs:20:5 + | +16 | struct EncodingFixture { + | --------------- field in this struct +... +20 | description: &'static str, + | ^^^^^^^^^^^ + | + = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default + +warning: `pdftract-core` (test "encoding_recovery") generated 2 warnings +warning: unused import: `std::path::Path` + --> crates/pdftract-core/tests/ocr_integration.rs:12:5 + | +12 | use std::path::Path; + | ^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: function `tesseract_available` is never used + --> crates/pdftract-core/tests/ocr_integration.rs:15:4 + | +15 | fn tesseract_available() -> bool { + | ^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default + +warning: `pdftract-core` (test "ocr_integration") generated 2 warnings (run `cargo fix --test "ocr_integration" -p pdftract-core` to apply 1 suggestion) +warning: unused import: `std::sync::Arc` + --> crates/pdftract-core/tests/debug_fingerprint.rs:87:9 + | +87 | use std::sync::Arc; + | ^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: `pdftract-core` (test "debug_fingerprint") generated 1 warning (run `cargo fix --test "debug_fingerprint" -p pdftract-core` to apply 1 suggestion) +warning: unused import: `pdftract_core::source::PdfSource` + --> crates/pdftract-core/tests/http_range_integration.rs:6:5 + | +6 | use pdftract_core::source::PdfSource; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: unused variable: `length` + --> crates/pdftract-core/tests/http_range_integration.rs:350:13 + | +350 | let length = 0usize; + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_length` + | + = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default + +warning: `pdftract-core` (test "http_range_integration") generated 2 warnings (run `cargo fix --test "http_range_integration" -p pdftract-core` to apply 2 suggestions) +warning: unused import: `PdfDict` + --> crates/pdftract-core/tests/test_lzw_debug.rs:2:37 + | +2 | use pdftract_core::parser::object::{PdfDict, PdfObject}; + | ^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: `pdftract-core` (test "test_lzw_debug") generated 1 warning (run `cargo fix --test "test_lzw_debug" -p pdftract-core` to apply 1 suggestion) +warning: unused variable: `resolver` + --> crates/pdftract-core/examples/test_pages_check.rs:7:29 + | +7 | Ok((fp, cat, pages, resolver)) => { + | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_resolver` + | + = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default + +warning: `pdftract-core` (example "test_pages_check") generated 1 warning (run `cargo fix --example "test_pages_check" -p pdftract-core` to apply 1 suggestion) +warning: unused import: `PdfDict` + --> crates/pdftract-core/tests/test_decoder_debug.rs:4:37 + | +4 | use pdftract_core::parser::object::{PdfDict, PdfObject}; + | ^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: unused import: `normalize_filter_name` + --> crates/pdftract-core/tests/test_decoder_debug.rs:6:5 + | +6 | normalize_filter_name, ASCII85Decoder, FlateDecoder, LZWDecoder, StreamDecoder, + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: `pdftract-core` (test "test_decoder_debug") generated 2 warnings (run `cargo fix --test "test_decoder_debug" -p pdftract-core` to apply 2 suggestions) +warning: unused import: `Path` + --> crates/pdftract-core/tests/verify_proptest_catches_bugs.rs:67:21 + | +67 | use std::path::{Path, PathBuf}; + | ^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: `pdftract-core` (test "verify_proptest_catches_bugs") generated 1 warning (run `cargo fix --test "verify_proptest_catches_bugs" -p pdftract-core` to apply 1 suggestion) +warning: unused import: `pdftract_core::parser::xref::XrefResolver` + --> crates/pdftract-core/examples/debug_page_tree.rs:5:5 + | +5 | use pdftract_core::parser::xref::XrefResolver; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: `pdftract-core` (example "debug_page_tree") generated 1 warning (run `cargo fix --example "debug_page_tree" -p pdftract-core` to apply 1 suggestion) +warning: unused import: `pdftract_core::parser::xref::XrefSection` + --> crates/pdftract-core/examples/debug_xref.rs:4:5 + | +4 | use pdftract_core::parser::xref::XrefSection; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: `pdftract-core` (example "debug_xref") generated 1 warning (run `cargo fix --example "debug_xref" -p pdftract-core` to apply 1 suggestion) +warning: `pdftract-core` (lib test) generated 272 warnings (147 duplicates) (run `cargo fix --lib -p pdftract-core --tests` to apply 115 suggestions) +warning: unused import: `PdfSource` + --> crates/pdftract-core/tests/fingerprint_debug_content_edit.rs:4:49 + | +4 | use pdftract_core::parser::stream::{FileSource, PdfSource as ParserPdfSource}; + | ^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: `pdftract-core` (test "fingerprint_debug_content_edit") generated 1 warning +warning: unused import: `TcpListener` + --> crates/pdftract-core/tests/TH-03-mcp-no-auth.rs:15:28 + | +15 | use std::net::{SocketAddr, TcpListener, ToSocketAddrs}; + | ^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: unused imports: `ChildStderr` and `ChildStdout` + --> crates/pdftract-core/tests/TH-03-mcp-no-auth.rs:16:20 + | +16 | use std::process::{ChildStderr, ChildStdout, Command, Stdio}; + | ^^^^^^^^^^^ ^^^^^^^^^^^ + +warning: unused variable: `attempt` + --> crates/pdftract-core/tests/TH-03-mcp-no-auth.rs:281:9 + | +281 | for attempt in 0..10 { + | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_attempt` + | + = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default + +warning: unused variable: `attempt` + --> crates/pdftract-core/tests/TH-03-mcp-no-auth.rs:313:9 + | +313 | for attempt in 0..10 { + | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_attempt` + +warning: unused variable: `attempt` + --> crates/pdftract-core/tests/TH-03-mcp-no-auth.rs:349:9 + | +349 | for attempt in 0..10 { + | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_attempt` + +warning: unused variable: `attempt` + --> crates/pdftract-core/tests/TH-03-mcp-no-auth.rs:387:9 + | +387 | for attempt in 0..10 { + | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_attempt` + +warning: unused variable: `attempt` + --> crates/pdftract-core/tests/TH-03-mcp-no-auth.rs:438:9 + | +438 | for attempt in 0..10 { + | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_attempt` + +warning: struct `TestResult` is never constructed + --> crates/pdftract-core/tests/TH-03-mcp-no-auth.rs:25:8 + | +25 | struct TestResult { + | ^^^^^^^^^^ + | + = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default + +warning: function `read_initial_output_with_timeout` is never used + --> crates/pdftract-core/tests/TH-03-mcp-no-auth.rs:116:4 + | +116 | fn read_initial_output_with_timeout( + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: function `try_connect_to_bound_port` is never used + --> crates/pdftract-core/tests/TH-03-mcp-no-auth.rs:184:4 + | +184 | fn try_connect_to_bound_port(port: u16, timeout_ms: u64) -> bool { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: function `extract_bound_port` is never used + --> crates/pdftract-core/tests/TH-03-mcp-no-auth.rs:201:4 + | +201 | fn extract_bound_port(output: &str) -> Option { + | ^^^^^^^^^^^^^^^^^^ + +warning: `pdftract-core` (test "TH-03-mcp-no-auth") generated 11 warnings (run `cargo fix --test "TH-03-mcp-no-auth" -p pdftract-core` to apply 7 suggestions) +warning: unused variable: `test_name` + --> crates/pdftract-core/tests/error_recovery_integration.rs:50:23 + | +50 | fn assert_no_panic(test_name: &str, f: F) -> Result<(), Box> + | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_test_name` + | + = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default + +warning: fields `expected_pages`, `expected_objects`, and `expected_behavior` are never read + --> crates/pdftract-core/tests/error_recovery_integration.rs:21:5 + | +17 | struct ExpectedDiagnostics { + | ------------------- fields in this struct +... +21 | expected_pages: Option, + | ^^^^^^^^^^^^^^ +22 | #[serde(default)] +23 | expected_objects: Option, + | ^^^^^^^^^^^^^^^^ +24 | #[serde(default)] +25 | expected_behavior: Option, + | ^^^^^^^^^^^^^^^^^ + | + = note: `ExpectedDiagnostics` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis + = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default + +warning: field `description` is never read + --> crates/pdftract-core/tests/error_recovery_integration.rs:32:5 + | +29 | struct ExpectedDiagnostic { + | ------------------ field in this struct +... +32 | description: String, + | ^^^^^^^^^^^ + | + = note: `ExpectedDiagnostic` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis + +warning: function `assert_diagnostic_count_at_least` is never used + --> crates/pdftract-core/tests/error_recovery_integration.rs:36:4 + | +36 | fn assert_diagnostic_count_at_least(diagnostics: &[String], code: &str, min_count: usize) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: `pdftract-core` (test "error_recovery_integration") generated 4 warnings (run `cargo fix --test "error_recovery_integration" -p pdftract-core` to apply 1 suggestion) +warning: unused import: `PdfDict` + --> crates/pdftract-core/tests/stream_decoder_fixtures.rs:8:37 + | +8 | use pdftract_core::parser::object::{PdfDict, PdfObject}; + | ^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: field `expected_diags` is never read + --> crates/pdftract-core/tests/stream_decoder_fixtures.rs:22:5 + | +18 | struct FixtureInfo { + | ----------- field in this struct +... +22 | expected_diags: Vec, + | ^^^^^^^^^^^^^^ + | + = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default + +warning: unused imports: `ObjectParser`, `PdfDict`, `PdfObject`, and `intern` + --> crates/pdftract-core/tests/object_parser_proptest.rs:6:37 + | +6 | use pdftract_core::parser::object::{intern, ObjectParser, PdfDict, PdfObject}; + | ^^^^^^ ^^^^^^^^^^^^ ^^^^^^^ ^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: unused import: `proptest::prelude::*` + --> crates/pdftract-core/tests/object_parser_proptest.rs:7:5 + | +7 | use proptest::prelude::*; + | ^^^^^^^^^^^^^^^^^^^^ + +warning: `pdftract-core` (test "object_parser_proptest") generated 2 warnings (run `cargo fix --test "object_parser_proptest" -p pdftract-core` to apply 2 suggestions) +warning: variant `UnsupportedPlatform` is never constructed + --> crates/pdftract-core/tests/memory_guard.rs:61:5 + | +59 | pub enum MemoryGuardError { + | ---------------- variant in this enum +60 | /// Platform does not support memory limits (e.g., Windows). +61 | UnsupportedPlatform, + | ^^^^^^^^^^^^^^^^^^^ + | + = note: `MemoryGuardError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis + = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default + +warning: `pdftract-core` (test "stream_decoder_fixtures") generated 2 warnings (run `cargo fix --test "stream_decoder_fixtures" -p pdftract-core` to apply 1 suggestion) +warning: `pdftract-core` (test "memory_guard_tests") generated 1 warning + Finished `test` profile [unoptimized + debuginfo] target(s) in 29.48s +──────────── + Nextest run ID aac87d66-6a53-4fbe-a21b-744d08947f3a with nextest profile: default + Starting 0 tests across 61 binaries (3211 tests skipped) +──────────── + Summary [ 0.004s] 0 tests run: 0 passed, 3211 skipped +error: no tests to run +(hint: use `--no-tests` to customize) +error: unexpected argument '--test-threads' found + + tip: a similar argument exists: '--test' + tip: to pass '--test-threads' as a value, use '-- --test-threads' + +Usage: cargo test --package [] --test [] [TESTNAME] [-- [ARGS]...] + +For more information, try '--help'. + +running 7 tests +test test_cmap_multiple_mappings_with_unmapped_check ... ok +test test_cmap_range_mapping_with_unmapped_awareness ... ok +test test_cmap_unmapped_glyph_skip ... ok +test test_differences_overlay_consecutive_with_unmapped_filtering ... ok +test test_differences_overlay_filters_all_g_series_unmapped ... ok +test test_differences_overlay_filters_null_glyph ... ok +test test_differences_overlay_filters_unmapped_glyphs ... ok + +test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s +