diff --git a/tokio/src/io/util/async_read_ext.rs b/tokio/src/io/util/async_read_ext.rs index 179e4834d69..7588f822fb6 100644 --- a/tokio/src/io/util/async_read_ext.rs +++ b/tokio/src/io/util/async_read_ext.rs @@ -230,10 +230,13 @@ cfg_io_util! { /// let mut buffer = BytesMut::with_capacity(10); /// /// assert!(buffer.is_empty()); + /// assert!(buffer.capacity() >= 10); /// - /// // read up to 10 bytes, note that the return value is not needed - /// // to access the data that was read as `buffer`'s internal - /// // cursor is updated. + /// // note that the return value is not needed to access the data + /// // that was read as `buffer`'s internal cursor is updated. + /// // + /// // this might read more than 10 bytes if the capacity of `buffer` + /// // is larger than 10. /// f.read_buf(&mut buffer).await?; /// /// println!("The bytes: {:?}", &buffer[..]);