Skip to content

Commit

Permalink
Fix buffer length in std::io::take
Browse files Browse the repository at this point in the history
This only reads five bytes, so don't use a ten byte buffer, that's confusing.
  • Loading branch information
steveklabnik committed Jul 27, 2015
1 parent d019a49 commit e88ee95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libstd/io/mod.rs
Expand Up @@ -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);
Expand Down

0 comments on commit e88ee95

Please sign in to comment.