Skip to content

Commit dec048b

Browse files
Document that BytesMut::reserve may not preserve memory outside 0..len
1 parent acd1e0f commit dec048b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

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)