Skip to content

Commit 1151d5f

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

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/bytes_mut.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,9 @@ impl BytesMut {
551551
/// and the original buffer is large enough to fit the requested additional
552552
/// capacity, then reallocations will never happen.
553553
///
554+
/// Once this method has been called, the contents of memory outside of
555+
/// `0..len` are undefined and may be uninitialized.
556+
///
554557
/// # Examples
555558
///
556559
/// In the following example, a new buffer is allocated.

0 commit comments

Comments
 (0)