diff options
author | 2017-08-06 12:12:26 +0800 | |
---|---|---|
committer | 2017-08-05 21:12:26 -0700 | |
commit | 7839100389bf28df00943d45e0f5516873a8e8dc (patch) | |
tree | 08753239f416a41acfe8bdc265a74d70f0d5fbf2 /src | |
parent | 6750a26fd0232209d8e1230fa12248a87ead1551 (diff) | |
download | bytes-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.rs | 2 |
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() } |