Skip to content
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

Beef up BufRead::consume docs #23622

Merged
merged 1 commit into from
Mar 24, 2015
Merged

Beef up BufRead::consume docs #23622

merged 1 commit into from
Mar 24, 2015

Conversation

steveklabnik
Copy link
Member

Fixes #23196

@rust-highfive
Copy link
Collaborator

r? @pcwalton

(rust_highfive has picked a reviewer for you, use r? to override)

@@ -558,6 +558,10 @@ pub trait BufRead: Read {
/// This function does not perform any I/O, it simply informs this object
/// that some amount of its buffer, returned from `fill_buf`, has been
/// consumed and should no longer be returned.
///
/// This function is used to tell the buffer how many bytes you've consumed from the return
/// value of `fill_buff`, and so may do odd things if `fill_buf` isn't called before calling
Copy link
Member

Choose a reason for hiding this comment

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

buff

@oli-obk
Copy link
Contributor

oli-obk commented Mar 23, 2015

also there's no mention that the number of bytes passed to consume must be <= to the number of bytes in the buffer returned by fill_buf

@steveklabnik
Copy link
Member Author

@oli-obk thanks! fixed. That naming convention is something I have yet to internalize, ugh.

///
/// This function is used to tell the buffer how many bytes you've consumed from the return
/// value of `fill_buf`, and so may do odd things if `fill_buf` isn't called before calling
/// this.
Copy link
Member

Choose a reason for hiding this comment

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

Can this follow the surrounding style of wrapping to 80 characters? Other than that r=me

@steveklabnik
Copy link
Member Author

@bors: r=alexcrichton rollup

@bors
Copy link
Contributor

bors commented Mar 23, 2015

📌 Commit a5e1cbe has been approved by alexcrichton

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.

BufReader .consume() confuses the Reader seek point when the buffer is empty
7 participants