From e00c08c6c7bff31309870d9e8bf55cfae2e5fc67 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Fri, 7 Oct 2016 12:55:18 -0700 Subject: [PATCH] Impl IntoBuf for &'static [u8] --- src/imp/buf/mod.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/imp/buf/mod.rs b/src/imp/buf/mod.rs index 9fde5c9..d13a99b 100644 --- a/src/imp/buf/mod.rs +++ b/src/imp/buf/mod.rs @@ -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 { type Buf = io::Cursor<&'a [u8]>;