From 5c631f3e58154ee203edc45fa2beacfc43d2907f Mon Sep 17 00:00:00 2001 From: Mikhail Borisov Date: Tue, 12 May 2015 15:16:06 +0300 Subject: [PATCH] WIP --- src/bytes.rs | 13 +++---------- src/de/value.rs | 2 +- 2 files changed, 4 insertions(+), 11 deletions(-) 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())) } }