Skip to content

Use exact slice chunks for wrapped encoding - #183

Closed
davidreic2 wants to merge 1 commit into
ia0:mainfrom
davidreic2:white-bounty/safe-codec-chunks
Closed

davidreic2 wants to merge 1 commit into
ia0:mainfrom
davidreic2:white-bounty/safe-codec-chunks

Conversation

@davidreic2

Copy link
Copy Markdown

Refs #74.

Wrapped encoding uses runtime line widths. Iterate over full input lines with chunks_exact, pair them with their output slices, and use the iterator's remainder for the final partial line. This removes both calls to the unchecked chunk helpers from encode_wrap_mut. The change is scoped to line wrapping and preserves compatibility with Rust 1.48.

The library tests passed, including padded and unpadded encodings for empty, exact-width and partial lines (34 integration tests and 42 doctests passed, one doctest ignored). The library also passed cargo check --no-default-features and compiled without features on Rust 1.48.0.

Contributed by David Reichhardt (samambai), with OpenAI Codex assistance on the implementation, validation and PR text.

@ia0

ia0 commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Thanks for the PR, but the idea of #74 was to get rid of the custom chunk_unchecked{,_mut} functions, which we can't do without bumping MSRV, which I don't think make sense for v2. This will be fixed in v3 eventually, but this is still under heavy development and redesign.

@ia0 ia0 closed this Nov 23, 2026
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.

2 participants