Skip to content

BREAKING CHANGE: v0.0.9 -> add metadata preserver - #8

Merged
alejandrogzi merged 1 commit into
masterfrom
v0.0.9
Jul 26, 2026
Merged

alejandrogzi merged 1 commit into
masterfrom
v0.0.9

Conversation

@alejandrogzi

Copy link
Copy Markdown
Owner

[0.0.9] - 2026-07-26

Added

  • MetadataIter zero-copy metadata line iterator — a new iterator type in
    io::reader that scans the reader's shared mmap/owned buffer without
    allocating and yields comment lines (those beginning with #) in input
    order. Each yielded item is a &[u8] slice that borrows the reader's
    underlying buffer directly, stripping only trailing newline and optional \r
    bytes. This makes metadata extraction both allocation-free and safe to call on
    any chain input.

  • Reader::metadata_lines() method — returns a MetadataIter over the
    original chain input. The iterator starts at byte 0 and scans forward,
    yielding every #-prefixed line encountered. It is exposed as part of the
    public API (MetadataIter is re-exported from the crate root).

  • Comment-line resilience in the parser — parse_chains_sequential and
    locate_chain_ranges now skip #-prefixed lines alongside blank lines,
    so chain files that embed metadata comments (for example, output from other
    UCSC tools) are parsed correctly instead of causing errors.

Tests

  • Two new tests validate the metadata iterator: one confirms zero-copy
    semantics by comparing raw pointer offsets against known input positions,
    and one verifies that a comment-free input yields an empty iterator.

@alejandrogzi
alejandrogzi merged commit da54c3a into master Jul 26, 2026
2 checks passed
@alejandrogzi
alejandrogzi deleted the v0.0.9 branch July 26, 2026 11:57
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