Skip to content

Commit

Permalink
io: use vec in example for AsyncReadExt::read_exact (#5863)
Browse files Browse the repository at this point in the history
  • Loading branch information
avdb13 committed Jul 16, 2023
1 parent 6166e9b commit 33d6d4f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tokio/src/io/util/async_read_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;
Expand Down

0 comments on commit 33d6d4f

Please sign in to comment.