mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-07 00:00:13 +02:00
Document that BytesMut::{reserve,try_reserve} doesn't preserve unused capacity (#808)
This commit is contained in:
@@ -551,6 +551,8 @@ impl BytesMut {
|
|||||||
/// and the original buffer is large enough to fit the requested additional
|
/// and the original buffer is large enough to fit the requested additional
|
||||||
/// capacity, then reallocations will never happen.
|
/// capacity, then reallocations will never happen.
|
||||||
///
|
///
|
||||||
|
/// This method does not preserve data stored in the unused capacity.
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// In the following example, a new buffer is allocated.
|
/// In the following example, a new buffer is allocated.
|
||||||
@@ -797,6 +799,8 @@ impl BytesMut {
|
|||||||
/// references through other `BytesMut`s or `Bytes` which point to the same underlying
|
/// references through other `BytesMut`s or `Bytes` which point to the same underlying
|
||||||
/// storage.
|
/// storage.
|
||||||
///
|
///
|
||||||
|
/// This method does not preserve data stored in the unused capacity.
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
|||||||
Reference in New Issue
Block a user