Keep capacity when unsplit on empty other buf (#502)

This commit is contained in:
Gbillou
2021-07-05 16:46:17 +02:00
committed by GitHub
parent ed1d24e570
commit baaf12d22a
2 changed files with 26 additions and 1 deletions
+1 -1
View File
@@ -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(());
}