io: use vec in example for AsyncReadExt::read_exact (#5863)

This commit is contained in:
avdb
2023-07-16 16:11:05 +02:00
committed by GitHub
parent 6166e9bcad
commit 33d6d4f63c
+2 -1
View File
@@ -292,7 +292,8 @@ cfg_io_util! {
/// #[tokio::main]
/// async fn main() -> io::Result<()> {
/// let mut f = File::open("foo.txt").await?;
/// let mut buffer = [0; 10];
/// let len = 10;
/// let mut buffer = vec![0; len];
///
/// // read exactly 10 bytes
/// f.read_exact(&mut buffer).await?;