From a2c2413bc587e5e63d7884e4b6bc931f2b306ddb Mon Sep 17 00:00:00 2001 From: Fedor Sakharov Date: Fri, 6 Sep 2019 17:45:24 +0300 Subject: [PATCH] fixes docs for io::buf_read::read_until --- src/io/buf_read.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/io/buf_read.rs b/src/io/buf_read.rs index b05bf89..74242ba 100644 --- a/src/io/buf_read.rs +++ b/src/io/buf_read.rs @@ -54,7 +54,7 @@ pub trait BufRead { /// /// let mut file = BufReader::new(File::open("a.txt").await?); /// - /// let mut buf = vec![0; 1024]; + /// let mut buf = Vec::with_capacity(1024); /// let n = file.read_until(b'\n', &mut buf).await?; /// # /// # Ok(()) }) }