Fix #352 -- Make freeze respect the start offset for BytesMuts in Vec mode

This commit is contained in:
Tim Hambourger
2020-03-24 11:14:16 -07:00
committed by Sean McArthur
parent fe6e673864
commit 8bbe9dd87b
2 changed files with 69 additions and 1 deletions
+3 -1
View File
@@ -233,7 +233,9 @@ impl BytesMut {
let (off, _) = self.get_vec_pos();
let vec = rebuild_vec(self.ptr.as_ptr(), self.len, self.cap, off);
mem::forget(self);
vec.into()
let mut b: Bytes = vec.into();
b.advance(off);
b
}
} else {
debug_assert_eq!(self.kind(), KIND_ARC);