mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-24 00:00:14 +02:00
Impl IntoBuf for &'static [u8]
This commit is contained in:
@@ -389,6 +389,16 @@ impl<'a> IntoBuf for &'a [u8] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Kind of annoying...
|
||||||
|
impl<'a> IntoBuf for &'a &'static [u8] {
|
||||||
|
type Buf = io::Cursor<&'static [u8]>;
|
||||||
|
|
||||||
|
/// Creates a buffer from a value
|
||||||
|
fn into_buf(self) -> Self::Buf {
|
||||||
|
io::Cursor::new(self)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'a> IntoBuf for &'a Vec<u8> {
|
impl<'a> IntoBuf for &'a Vec<u8> {
|
||||||
type Buf = io::Cursor<&'a [u8]>;
|
type Buf = io::Cursor<&'a [u8]>;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user