mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-15 00:00:18 +02:00
Fix #352 -- Make freeze respect the start offset for BytesMuts in Vec mode
This commit is contained in:
committed by
Sean McArthur
parent
fe6e673864
commit
8bbe9dd87b
+3
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user