Skip to content

added docs +doctests to BufRead::consume #782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

feefladder
Copy link

@feefladder feefladder commented Mar 24, 2025

Currently, documentation for BufRead::consume links to the normal docs that mention there could be a logic error when calling consume, even though this function calls advance internally, which should be safe/no logic error if the user knows the size of the underlying buffer. This pr adds documentation for that.

Specifically, the issue I had was that there is no advance-like function on a buf.reader(), even though I knew the underlying buffer size (and I think more people will know it?)

CI: https://github.com/feefladder/bytes/actions/runs/14041549907

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