diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index e263db24fc2..076524e624a 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -431,7 +431,7 @@ fn read_to_end_with_reservation(r: &mut R, /// // read up to 10 bytes /// f.read(&mut buffer)?; /// -/// let mut buffer = vec![0; 10]; +/// let mut buffer = Vec::new(); /// // read the whole file /// f.read_to_end(&mut buffer)?; ///