mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-29 12:38:58 -06:00
The total budget of the outline count (100,000 items) was checked against the number of indirect items the walk had reached. Items written inline, as a direct dictionary, were counted in the result but never entered that set, so an outline of 60,000 indirect siblings, each with one inline child, counted 120,000 items. The walk now keeps a separate running total of every item it counts, inline items included, and stops when that total reaches the budget. The set of indirect items is still used to count shared items once. Ordinary outlines count as before. The doc comment of the walk now states the depth limit in one sentence: an item first reached through a deeper path is not visited again from a shallower one, so items nested past depth 64 may stay uncounted. The depth behaviour is unchanged. Test added in crates/redact/src/tests.rs: inline_outline_children_count_towards_the_total_budget. It reads 120000 on the previous head and 100000 now. Reverting the budget check to the indirect-only count fails it; reverting the increment fails it and the existing total budget test. The other outline tests pass unchanged. Checked with cargo fmt --all -- --check, clippy with -D warnings on pdfcraft-redact, and cargo test for pdfcraft-redact (85 passed, 0 failed).