Fix buffer length in std::io::take
This only reads five bytes, so don't use a ten byte buffer, that's confusing.
This commit is contained in:
parent
d019a49ac8
commit
e88ee957ed
1 changed files with 1 additions and 1 deletions
|
@ -707,7 +707,7 @@ pub trait Read {
|
|||
///
|
||||
/// # fn foo() -> io::Result<()> {
|
||||
/// let mut f = try!(File::open("foo.txt"));
|
||||
/// let mut buffer = [0; 10];
|
||||
/// let mut buffer = [0; 5];
|
||||
///
|
||||
/// // read at most five bytes
|
||||
/// let mut handle = f.take(5);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue