Repository navigation
BREAKING CHANGE: v0.0.9 -> add metadata preserver - #8
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[0.0.9] - 2026-07-26
Added
MetadataIterzero-copy metadata line iterator — a new iterator type inio::readerthat scans the reader's shared mmap/owned buffer withoutallocating and yields comment lines (those beginning with
#) in inputorder. Each yielded item is a
&[u8]slice that borrows the reader'sunderlying buffer directly, stripping only trailing newline and optional
\rbytes. This makes metadata extraction both allocation-free and safe to call on
any chain input.
Reader::metadata_lines()method — returns aMetadataIterover theoriginal chain input. The iterator starts at byte 0 and scans forward,
yielding every
#-prefixed line encountered. It is exposed as part of thepublic API (
MetadataIteris re-exported from the crate root).Comment-line resilience in the parser —
parse_chains_sequentialandlocate_chain_rangesnow 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
semantics by comparing raw pointer offsets against known input positions,
and one verifies that a comment-free input yields an empty iterator.