Skip to content

std::io::util cleanup + fixes #16513

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

Closed
wants to merge 1 commit into from

Conversation

sfackler
Copy link
Member

  • Fix LimitReader's Buffer::consume impl to avoid limit underflow
  • Make MultiWriter fail fast instead of always running through each
    Writer. This may or may not be what we want, but it at least
    doesn't throw any errors encountered in later Writers into oblivion.
  • Prevent IterReader's Reader::read impl from returning EOF if given
    an empty buffer.

[breaking-change]

* Fix `LimitReader`'s `Buffer::consume` impl to avoid limit underflow
* Make `MultiWriter` fail fast instead of always running through each
    `Writer`. This may or may not be what we want, but it at least
    doesn't throw any errors encountered in later `Writer`s into oblivion.
* Prevent `IterReader`'s `Reader::read` impl from returning EOF if given
    an empty buffer.

[breaking-change]
@lilyball
Copy link
Contributor

I'm not convinced the MultiWriter change is appropriate. Does it really matter if the other errors are thrown into oblivion? If they're permanent errors, they'll reoccur on the next write, and if they're temporary errors, then it doesn't seem like a big deal. I guess the question is, who actually uses MultiWriter today, and what behavior is best for them?

@alexcrichton
Copy link
Member

For comparison, Go's MultiWriter fails fast.

@lilyball
Copy link
Contributor

Apparently the answer is "nobody uses MultiWriter". At least, nobody in the rust-lang/rust tree. Given that, I withdraw my objection regarding MultiWriter.

bors added a commit that referenced this pull request Aug 16, 2014
* Fix `LimitReader`'s `Buffer::consume` impl to avoid limit underflow
* Make `MultiWriter` fail fast instead of always running through each
    `Writer`. This may or may not be what we want, but it at least
    doesn't throw any errors encountered in later `Writer`s into oblivion.
* Prevent `IterReader`'s `Reader::read` impl from returning EOF if given
    an empty buffer.

[breaking-change]
@bors bors closed this Aug 16, 2014
@sfackler sfackler deleted the io-util-cleanup branch November 26, 2016 05:53
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.

4 participants