Skip to content
Snippets Groups Projects
Commit 6f97d040 authored by Carl Lerche's avatar Carl Lerche
Browse files

Add IntoBuf impls for non-ref types

parent e00c08c6
No related branches found
No related tags found
No related merge requests found
......@@ -399,6 +399,14 @@ impl<'a> IntoBuf for &'a &'static [u8] {
}
}
impl IntoBuf for Vec<u8> {
type Buf = io::Cursor<Vec<u8>>;
fn into_buf(self) -> Self::Buf {
io::Cursor::new(self)
}
}
impl<'a> IntoBuf for &'a Vec<u8> {
type Buf = io::Cursor<&'a [u8]>;
......@@ -407,6 +415,14 @@ impl<'a> IntoBuf for &'a Vec<u8> {
}
}
impl IntoBuf for () {
type Buf = io::Cursor<&'static [u8]>;
fn into_buf(self) -> Self::Buf {
io::Cursor::new(&[])
}
}
impl<'a> IntoBuf for &'a () {
type Buf = io::Cursor<&'static [u8]>;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment