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
@ -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…
x
Reference in New Issue
Block a user