aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Evan Cameron <cameron.evan@gmail.com> 2022-04-06 09:19:00 -0400
committerGravatar GitHub <noreply@github.com> 2022-04-06 15:19:00 +0200
commit9e6edd18d297ec1b1bf9e01b1fce7a52eacdd8cc (patch)
treebedbe640e9b153e1300a7b9d06247debd9ff4f6a
parente4c723697d49b5b6fa1ae92db18e9affe6c6744f (diff)
downloadbytes-9e6edd18d297ec1b1bf9e01b1fce7a52eacdd8cc.tar.gz
bytes-9e6edd18d297ec1b1bf9e01b1fce7a52eacdd8cc.tar.zst
bytes-9e6edd18d297ec1b1bf9e01b1fce7a52eacdd8cc.zip
Clarify `BytesMut::unsplit` docs (#535)
-rw-r--r--src/bytes_mut.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/bytes_mut.rs b/src/bytes_mut.rs
index 868b955..d13cf05 100644
--- a/src/bytes_mut.rs
+++ b/src/bytes_mut.rs
@@ -733,10 +733,11 @@ impl BytesMut {
/// Absorbs a `BytesMut` that was previously split off.
///
- /// If the two `BytesMut` objects were previously contiguous, i.e., if
- /// `other` was created by calling `split_off` on this `BytesMut`, then
- /// this is an `O(1)` operation that just decreases a reference
- /// count and sets a few indices. Otherwise this method degenerates to
+ /// If the two `BytesMut` objects were previously contiguous and not mutated
+ /// in a way that causes re-allocation i.e., if `other` was created by
+ /// calling `split_off` on this `BytesMut`, then this is an `O(1)` operation
+ /// that just decreases a reference count and sets a few indices.
+ /// Otherwise this method degenerates to
/// `self.extend_from_slice(other.as_ref())`.
///
/// # Examples