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

Implement BufRead for Chain #32541

Merged
merged 3 commits into from
Mar 29, 2016
Merged

Implement BufRead for Chain #32541

merged 3 commits into from
Mar 29, 2016

Conversation

troplin
Copy link
Contributor

@troplin troplin commented Mar 27, 2016

Addresses #32536

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

impl<T: BufRead, U: BufRead> BufRead for Chain<T, U> {
fn fill_buf(&mut self) -> Result<&[u8]> {
if !self.done_first {
match try!(self.first.fill_buf()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

As I mentioned in #32536, you should probably use the ? operator here.

@alexcrichton
Copy link
Member

Thanks! Could you add some tests here as well?

@troplin
Copy link
Contributor Author

troplin commented Mar 28, 2016

@alexcrichton Where should I put the tests? src/test/run-pass?
Name it after the issue or after the feature?
How extensive do they have to be?

@alexcrichton
Copy link
Member

Either src/test/run-pass or in std::io directly (there's a few others in there I believe). I'd like at least a smoke test to ensure that anything works but some corner case tests might also be useful.

@sfackler
Copy link
Member

Looks good to me, but deferring the r to @alexcrichton

(github unfortunately doesn't notify reviewers when new commits are pushed to a PR, so you may want to ping the comments after making changes, BTW)

@alexcrichton
Copy link
Member

@bors: r+ f611e44

Thanks @troplin!

@bors
Copy link
Contributor

bors commented Mar 29, 2016

⌛ Testing commit f611e44 with merge 161c541...

bors added a commit that referenced this pull request Mar 29, 2016
@bors bors merged commit f611e44 into rust-lang:master Mar 29, 2016
@troplin
Copy link
Contributor Author

troplin commented Mar 29, 2016

Yay! 😃
Thanks everyone for the support!

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.

7 participants