Skip to content

Commit 94e4291

Browse files
Document that BytesMut::{reserve,try_reserve} doesn't preserve unused capacity (#808)
1 parent acd1e0f commit 94e4291

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/bytes_mut.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,8 @@ impl BytesMut {
551551
/// and the original buffer is large enough to fit the requested additional
552552
/// capacity, then reallocations will never happen.
553553
///
554+
/// This method does not preserve data stored in the unused capacity.
555+
///
554556
/// # Examples
555557
///
556558
/// In the following example, a new buffer is allocated.
@@ -797,6 +799,8 @@ impl BytesMut {
797799
/// references through other `BytesMut`s or `Bytes` which point to the same underlying
798800
/// storage.
799801
///
802+
/// This method does not preserve data stored in the unused capacity.
803+
///
800804
/// # Examples
801805
///
802806
/// ```

0 commit comments

Comments
 (0)