mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-10-23 20:26:17 +00:00
Finish updating to rust HEAD
This commit is contained in:
1 parent
b30965ede4
commit
d0b49d9b89
4 files changed
+94
-64
No files matched your search
+11
-3
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user