Skip to content

Clarify that non-empty wrapped output ends with the separator - #181

Merged
ia0 merged 1 commit into
ia0:mainfrom
Marsman1996:doc-empty-input
Nov 8, 2026
Merged

ia0 merged 1 commit into
ia0:mainfrom
Marsman1996:doc-empty-input

Conversation

@Marsman1996

@Marsman1996 Marsman1996 commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

While formalizing the documented wrap behavior, I treated “the output always ends with the separator” as a universal property, but verification failed for empty input.

I’m not sure whether this is worth clarifying in the documentation. Empty input producing empty output may be obvious to users of encoding APIs, so would adding a “non-empty output” qualification be helpful, or would it be unnecessary detail?

@ia0 ia0 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the fix!

If you're formalizing this, it would be simpler (in my opinion) to say that you take the output without wrapping, then chunk it (e.g. using slice::chunks()) and add a separator after each such chunk, then concatenate. By construction, chunks are not empty. In particular, the empty output has no chunks, so no separator.

@ia0
ia0 merged commit f46ec5a into ia0:main Nov 8, 2026
2 checks passed
@ia0

ia0 commented Nov 8, 2026

Copy link
Copy Markdown
Owner

I forgot to update the CHANGELOG. Doing so in #182 .

@Marsman1996

Copy link
Copy Markdown
Contributor Author

Thanks a lot for the fix!

If you're formalizing this, it would be simpler (in my opinion) to say that you take the output without wrapping, then chunk it (e.g. using slice::chunks()) and add a separator after each such chunk, then concatenate. By construction, chunks are not empty. In particular, the empty output has no chunks, so no separator.

This helps, 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.

2 participants