Skip to content

Conversation

@Sekar-C-Mca
Copy link
Contributor

@Sekar-C-Mca Sekar-C-Mca commented Jan 2, 2026

Issue #149000

The previous documentation said 'via Read methods' which incorrectly implied that fill_buf consumes the data. This restores the historical clarification that read() can return the same contents as fill_buf, and emphasizes the relationship with consume().

This addresses the concerns raised in the issue where implementations like BufReader and Cursor do not actually consume data when fill_buf is called - subsequent read() calls can still read the same bytes until consume() is explicitly called.

The previous documentation said 'via Read methods' which incorrectly
implied that fill_buf consumes the data. This restores the historical
clarification that read() can return the same contents as fill_buf,
and emphasizes the relationship with consume().

This addresses the concerns raised in the issue where implementations
like BufReader and Cursor do not actually consume data when fill_buf
is called - subsequent read() calls can still read the same bytes
until consume() is explicitly called.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 2, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 2, 2026

r? @ChrisDenton

rustbot has assigned @ChrisDenton.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Copy link
Member

@ChrisDenton ChrisDenton left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks. I have a minor note but don't feel too strongly about it either way.

View changes since this review

/// Returns the contents of the internal buffer, filling it with more data from the underlying reader if it is empty.
///
/// This function will not read data into the buffer if some is already present.
/// When calling this method, none of the contents will be "read" in the sense that later
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps this could use the same phrasing as used for consume below? So something like:

When calling this method, none of the contents will be marked as "read"...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants