Skip to content

Show logical contents in collection and full-iterator Debug output - #118

Open
hakarrr wants to merge 1 commit into
orium:mainfrom
hakarrr:debug-collection-contents-45
Open

hakarrr wants to merge 1 commit into
orium:mainfrom
hakarrr:debug-collection-contents-45

Conversation

@hakarrr

@hakarrr hakarrr commented Nov 2, 2026

Copy link
Copy Markdown

Related to #45. This is a partial fix: range-iterator formatting remains unchanged to preserve its existing public Debug trait bounds.

The public collections currently print implementation details such as tree nodes, hashes and iterator stacks. This changes all eight collection types to list/map/set-style contents, with named wrappers for Queue and Stack. Full iterators show their remaining contents without consuming the iterator. Existing public Map/Chain iterator aliases are preserved, so the standard-library adapter wrappers are still visible.

The red-black full iterator formatter uses its remaining length and forward cursor, without adding an Ord requirement to Debug. Tests cover mixed front/back consumption, exhaustion, empty/singleton collections and generic-bound compatibility. RangeIterPtr retains its structural derived Debug; formatting its logical contents without narrowing its previous generic bounds needs a separate design.

Validation on this changeset:

  • cargo fmt --all -- --check and git diff --check
  • cargo test --lib test_debug --locked: 10 passed
  • cargo test --lib --locked: 268 passed
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo package --allow-dirty, including package verification
  • cargo +1.85.0 check --lib --locked
  • External generic-bound and bidirectional remaining-content witnesses passed.

The regression tests fail on the base. Rust 1.85 library tests are blocked by the existing criterion 0.8.2 dev-dependency requiring Rust 1.86, with the same result on the clean base and the patched tree using the same lockfile. No dependency or manifest changes are included. The all-features runtime suite was not rerun after the final iterator revision.

Keep existing public iterator aliases and Debug trait bounds. Leave range iterator formatting unchanged for compatibility.

Co-authored-by: generaltony007 <144252170+GeneralTony007@users.noreply.github.com>
@hakarrr

hakarrr commented Nov 13, 2026

Copy link
Copy Markdown
Author

I understand from your reply on #119 that review time is limited. Is this Debug-output change still in scope for your next review round, and is there anything you need changed first? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant