Finish updating to rust HEAD

This commit is contained in:
Erick Tryzelaar
2015-04-02 19:13:25 -07:00
parent b30965ede4
commit d0b49d9b89
4 changed files with 94 additions and 64 deletions
+11 -3
View File
@@ -12,10 +12,18 @@ pub struct Bytes<'a> {
bytes: &'a [u8],
}
impl<'a, T> From<T> for Bytes<'a> where T: Into<&'a [u8]> {
fn from(bytes: T) -> Self {
impl<'a> From<&'a [u8]> for Bytes<'a> {
fn from(bytes: &'a [u8]) -> Self {
Bytes {
bytes: bytes.into(),
bytes: bytes,
}
}
}
impl<'a> From<&'a Vec<u8>> for Bytes<'a> {
fn from(bytes: &'a Vec<u8>) -> Self {
Bytes {
bytes: &bytes,
}
}
}