Skip to content

std: Update the std::io adaptors to proxy all methods #22428

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

Merged
merged 1 commit into from
Feb 24, 2015

Conversation

erickt
Copy link
Contributor

@erickt erickt commented Feb 17, 2015

Also includes some minor optimizations to the Vec and slice writers to remove the unnecessary loop.

@rust-highfive
Copy link
Contributor

r? @aturon

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

if try!(self.write(data)) == data.len() {
Ok(())
} else {
Err(Error::new(ErrorKind::WriteZero, "failed to write whole buffer", None))
Copy link
Member

Choose a reason for hiding this comment

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

WriteZero seems like the wrong error for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sfackler: yeah, I agree. I kept the WriteZero because that's the error the Read::write_all supermethod returns. The fact that I'm not doing the loop is more of an implementation detail. Is it worth making a PartialWrite error kind?

Copy link
Member

Choose a reason for hiding this comment

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

This is indeed what WriteZero is intended for, but I think PartialWrite is actually a better name for it! cc @alexcrichton

@aturon
Copy link
Member

aturon commented Feb 20, 2015

Thanks!

@bors: r+ ded93b1

@bors
Copy link
Collaborator

bors commented Feb 21, 2015

⌛ Testing commit ded93b1 with merge 2e7441f...

@bors
Copy link
Collaborator

bors commented Feb 21, 2015

💔 Test failed - auto-win-64-nopt-t

@alexcrichton
Copy link
Member

@bors: retry

Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 24, 2015
 Also includes some minor optimizations to the Vec and slice writers to remove the unnecessary loop.
@bors bors merged commit ded93b1 into rust-lang:master Feb 24, 2015
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