aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Alex Crichton <alex@alexcrichton.com> 2017-08-06 12:12:26 +0800
committerGravatar Carl Lerche <me@carllerche.com> 2017-08-05 21:12:26 -0700
commit7839100389bf28df00943d45e0f5516873a8e8dc (patch)
tree08753239f416a41acfe8bdc265a74d70f0d5fbf2 /src
parent6750a26fd0232209d8e1230fa12248a87ead1551 (diff)
downloadbytes-7839100389bf28df00943d45e0f5516873a8e8dc.tar.gz
bytes-7839100389bf28df00943d45e0f5516873a8e8dc.tar.zst
bytes-7839100389bf28df00943d45e0f5516873a8e8dc.zip
Inline `as_ref` functions on `Bytes` and `BytesMut` (#154)
Diffstat (limited to 'src')
-rw-r--r--src/bytes.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/bytes.rs b/src/bytes.rs
index 6572434..c4cfcaa 100644
--- a/src/bytes.rs
+++ b/src/bytes.rs
@@ -793,6 +793,7 @@ impl Clone for Bytes {
}
impl AsRef<[u8]> for Bytes {
+ #[inline]
fn as_ref(&self) -> &[u8] {
self.inner.as_ref()
}
@@ -1391,6 +1392,7 @@ impl<'a> IntoBuf for &'a BytesMut {
}
impl AsRef<[u8]> for BytesMut {
+ #[inline]
fn as_ref(&self) -> &[u8] {
self.inner.as_ref()
}