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

Add a Reader::fill() method #13049

Merged
merged 2 commits into from
Mar 24, 2014
Merged

Add a Reader::fill() method #13049

merged 2 commits into from
Mar 24, 2014

Commits on Mar 22, 2014

  1. std: Add an I/O reader method to fill a buffer

    I've found a common use case being to fill a slice (not an owned vector)
    completely with bytes. It's posible for short reads to happen, and if you're
    trying to get an exact number of bytes then this helper will be useful.
    alexcrichton committed Mar 22, 2014
    Configuration menu
    Copy the full SHA
    5560383 View commit details
    Browse the repository at this point in the history
  2. rand: Use fill() instead of read()

    It's possible for a reader to have a short read, and there's no reason the task
    should fail in this scenario. By using fill(), this has a stronger guarantee
    that the buffer will get filled with data.
    alexcrichton committed Mar 22, 2014
    5 Configuration menu
    Copy the full SHA
    02dab5a View commit details
    Browse the repository at this point in the history