Commit 718dcc8 1 parent 10e141d commit 718dcc8 Copy full SHA for 718dcc8
File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -230,10 +230,13 @@ cfg_io_util! {
230
230
/// let mut buffer = BytesMut::with_capacity(10);
231
231
///
232
232
/// assert!(buffer.is_empty());
233
+ /// assert!(buffer.capacity() >= 10);
233
234
///
234
- /// // read up to 10 bytes, note that the return value is not needed
235
- /// // to access the data that was read as `buffer`'s internal
236
- /// // cursor is updated.
235
+ /// // note that the return value is not needed to access the data
236
+ /// // that was read as `buffer`'s internal cursor is updated.
237
+ /// //
238
+ /// // this might read more than 10 bytes if the capacity of `buffer`
239
+ /// // is larger than 10.
237
240
/// f.read_buf(&mut buffer).await?;
238
241
///
239
242
/// println!("The bytes: {:?}", &buffer[..]);
You can’t perform that action at this time.
0 commit comments