mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-27 00:00:17 +02:00
Inline as_ref functions on Bytes and BytesMut (#154)
This commit is contained in:
committed by
Carl Lerche
parent
6750a26fd0
commit
7839100389
@@ -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 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
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()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user