Skip to content

Commit e88ee95

Browse files
committed
Fix buffer length in std::io::take
This only reads five bytes, so don't use a ten byte buffer, that's confusing.
1 parent d019a49 commit e88ee95

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libstd/io/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ pub trait Read {
707707
///
708708
/// # fn foo() -> io::Result<()> {
709709
/// let mut f = try!(File::open("foo.txt"));
710-
/// let mut buffer = [0; 10];
710+
/// let mut buffer = [0; 5];
711711
///
712712
/// // read at most five bytes
713713
/// let mut handle = f.take(5);

0 commit comments

Comments
 (0)