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:
Steve Klabnik 2015-07-27 11:43:15 -04:00
parent d019a49ac8
commit e88ee957ed

View File

@ -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);