Skip to content

Commit 9e6edd1

Browse files
authored
Clarify BytesMut::unsplit docs (#535)
1 parent e4c7236 commit 9e6edd1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/bytes_mut.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -733,10 +733,11 @@ impl BytesMut {
733733

734734
/// Absorbs a `BytesMut` that was previously split off.
735735
///
736-
/// If the two `BytesMut` objects were previously contiguous, i.e., if
737-
/// `other` was created by calling `split_off` on this `BytesMut`, then
738-
/// this is an `O(1)` operation that just decreases a reference
739-
/// count and sets a few indices. Otherwise this method degenerates to
736+
/// If the two `BytesMut` objects were previously contiguous and not mutated
737+
/// in a way that causes re-allocation i.e., if `other` was created by
738+
/// calling `split_off` on this `BytesMut`, then this is an `O(1)` operation
739+
/// that just decreases a reference count and sets a few indices.
740+
/// Otherwise this method degenerates to
740741
/// `self.extend_from_slice(other.as_ref())`.
741742
///
742743
/// # Examples

0 commit comments

Comments
 (0)