diff --git a/src/bytes.rs b/src/bytes.rs index 5a6afa71..b3e02711 100644 --- a/src/bytes.rs +++ b/src/bytes.rs @@ -78,10 +78,6 @@ impl ByteBuf { bytes: Vec::with_capacity(cap) } } - - pub fn as_vec(self) -> Vec { - self.bytes - } } impl fmt::Debug for ByteBuf { @@ -90,19 +86,16 @@ impl fmt::Debug for ByteBuf { } } -/* -// Disabled: triggers conflict with From implementation below impl Into> for ByteBuf { fn into(self) -> Vec { self.bytes } } -*/ -impl From for ByteBuf where T: Into> { - fn from(bytes: T) -> Self { +impl From> for ByteBuf { + fn from(bytes: Vec) -> Self { ByteBuf { - bytes: bytes.into(), + bytes: bytes, } } } diff --git a/src/de/value.rs b/src/de/value.rs index 4ddbc299..e512badc 100644 --- a/src/de/value.rs +++ b/src/de/value.rs @@ -445,7 +445,7 @@ impl ValueDeserializer for bytes::ByteBuf type Deserializer = ByteBufDeserializer; fn into_deserializer(self) -> Self::Deserializer { - ByteBufDeserializer(Some(self.as_vec())) + ByteBufDeserializer(Some(self.into())) } }