mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-15 00:00:18 +02:00
Bytes: only the vec repr is not shared (#100)
The shared debug_assert is to ensure that the internal Bytes representation is such that offset views are supported. The only representation that does not support offset views is vec. Fixes #97
This commit is contained in:
+2
-2
@@ -1890,8 +1890,8 @@ impl Inner {
|
||||
#[inline]
|
||||
fn is_shared(&mut self) -> bool {
|
||||
match self.kind() {
|
||||
KIND_INLINE | KIND_ARC => true,
|
||||
_ => false,
|
||||
KIND_VEC => false,
|
||||
_ => true,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user