From fbb7272cba82dd4a607849ed3d77847fbe81e3f2 Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Thu, 12 Jul 2018 19:05:35 -0700 Subject: [PATCH] inline Bytes::len and Bytes::is_empty (#211) --- src/bytes.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bytes.rs b/src/bytes.rs index 54c411f..364ca3e 100644 --- a/src/bytes.rs +++ b/src/bytes.rs @@ -465,6 +465,7 @@ impl Bytes { /// let b = Bytes::from(&b"hello"[..]); /// assert_eq!(b.len(), 5); /// ``` + #[inline] pub fn len(&self) -> usize { self.inner.len() } @@ -479,6 +480,7 @@ impl Bytes { /// let b = Bytes::new(); /// assert!(b.is_empty()); /// ``` + #[inline] pub fn is_empty(&self) -> bool { self.inner.is_empty() }