use std::ops::Deref; /// A `Vec` that isn't prefixed by a VarInt with the size. #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct UnsizedByteArray(pub Vec); impl Deref for UnsizedByteArray { type Target = [u8]; fn deref(&self) -> &Self::Target { &self.0 } } impl From> for UnsizedByteArray { fn from(vec: Vec) -> Self { Self(vec) } } impl From<&str> for UnsizedByteArray { fn from(s: &str) -> Self { Self(s.as_bytes().to_vec()) } }