aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Gbillou <7978569+Gbillou@users.noreply.github.com> 2021-07-05 16:46:17 +0200
committerGravatar GitHub <noreply@github.com> 2021-07-05 16:46:17 +0200
commitbaaf12d22a844350998d2f60ab3bc78df12ab29a (patch)
tree3e9e65d01cfe44d3e9723060bfc94d19571d02a9 /src
parented1d24e57079a86c6201b5fd6be6f789265f0e6a (diff)
downloadbytes-baaf12d22a844350998d2f60ab3bc78df12ab29a.tar.gz
bytes-baaf12d22a844350998d2f60ab3bc78df12ab29a.tar.zst
bytes-baaf12d22a844350998d2f60ab3bc78df12ab29a.zip
Keep capacity when unsplit on empty other buf (#502)
Diffstat (limited to 'src')
-rw-r--r--src/bytes_mut.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bytes_mut.rs b/src/bytes_mut.rs
index 2af58e3..8e42079 100644
--- a/src/bytes_mut.rs
+++ b/src/bytes_mut.rs
@@ -819,7 +819,7 @@ impl BytesMut {
}
fn try_unsplit(&mut self, other: BytesMut) -> Result<(), BytesMut> {
- if other.is_empty() {
+ if other.capacity() == 0 {
return Ok(());
}