Skip to content
Snippets Groups Projects
Commit 78391003 authored by Alex Crichton's avatar Alex Crichton Committed by Carl Lerche
Browse files

Inline `as_ref` functions on `Bytes` and `BytesMut` (#154)

parent 6750a26f
Branches
No related tags found
No related merge requests found
...@@ -793,6 +793,7 @@ impl Clone for Bytes { ...@@ -793,6 +793,7 @@ impl Clone for Bytes {
} }
impl AsRef<[u8]> for Bytes { impl AsRef<[u8]> for Bytes {
#[inline]
fn as_ref(&self) -> &[u8] { fn as_ref(&self) -> &[u8] {
self.inner.as_ref() self.inner.as_ref()
} }
...@@ -1391,6 +1392,7 @@ impl<'a> IntoBuf for &'a BytesMut { ...@@ -1391,6 +1392,7 @@ impl<'a> IntoBuf for &'a BytesMut {
} }
impl AsRef<[u8]> for BytesMut { impl AsRef<[u8]> for BytesMut {
#[inline]
fn as_ref(&self) -> &[u8] { fn as_ref(&self) -> &[u8] {
self.inner.as_ref() self.inner.as_ref()
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment