diff --git a/src/hpack/decoder.rs b/src/hpack/decoder.rs index 97eb89b83..4befa8702 100644 --- a/src/hpack/decoder.rs +++ b/src/hpack/decoder.rs @@ -430,7 +430,7 @@ fn take(buf: &mut Cursor<&mut BytesMut>, n: usize) -> Bytes { let pos = buf.position() as usize; let mut head = buf.get_mut().split_to(pos + n); buf.set_position(0); - head.split_to(pos); + head.advance(pos); head.freeze() }