Skip to content

Commit 55e2968

Browse files
authored
Clarifying actions of clear and truncate. (#508)
1 parent 0e9fa0b commit 55e2968

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/bytes_mut.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,8 @@ impl BytesMut {
380380
/// If `len` is greater than the buffer's current length, this has no
381381
/// effect.
382382
///
383+
/// Existing underlying capacity is preserved.
384+
///
383385
/// The [`split_off`] method can emulate `truncate`, but this causes the
384386
/// excess bytes to be returned instead of dropped.
385387
///
@@ -402,7 +404,7 @@ impl BytesMut {
402404
}
403405
}
404406

405-
/// Clears the buffer, removing all data.
407+
/// Clears the buffer, removing all data. Existing capacity is preserved.
406408
///
407409
/// # Examples
408410
///

0 commit comments

Comments
 (0)