diff --git a/src/bytes.rs b/src/bytes.rs index 9e5a9a7d..5a6afa71 100644 --- a/src/bytes.rs +++ b/src/bytes.rs @@ -3,7 +3,6 @@ use std::ops; use std::fmt; use std::ascii; -use std::char; use ser; use de; @@ -91,6 +90,15 @@ 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 { ByteBuf { @@ -205,7 +213,7 @@ fn escape_bytestring(bytes: &[u8]) -> String { let mut result = String::new(); for &b in bytes { for esc in ascii::escape_default(b) { - result.push(char::from_u32(esc as u32).unwrap()); + result.push(esc as char); } } result