Change unused BytesMut::split_to to advance

This commit is contained in:
Sean McArthur
2020-01-29 15:17:56 -08:00
parent 74d02933a5
commit 8ca2eb2597

View File

@@ -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()
}