mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-16 00:00:12 +02:00
io: use vec in example for AsyncReadExt::read_exact (#5863)
This commit is contained in:
@@ -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?;
|
||||
|
||||
Reference in New Issue
Block a user