From 7839100389bf28df00943d45e0f5516873a8e8dc Mon Sep 17 00:00:00 2001 From: Alex Crichton <alex@alexcrichton.com> Date: Sun, 6 Aug 2017 12:12:26 +0800 Subject: [PATCH] Inline `as_ref` functions on `Bytes` and `BytesMut` (#154) --- src/bytes.rs | 2 ++ 1 file changed, 2 insertions(+) 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() } -- GitLab