From 9e6edd18d297ec1b1bf9e01b1fce7a52eacdd8cc Mon Sep 17 00:00:00 2001 From: Evan Cameron Date: Wed, 6 Apr 2022 09:19:00 -0400 Subject: [PATCH] Clarify `BytesMut::unsplit` docs (#535) --- src/bytes_mut.rs | 9 +++++---- 1 file 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