inline Bytes::len and Bytes::is_empty (#211)

This commit is contained in:
Sean McArthur
2018-07-12 19:05:35 -07:00
committed by Carl Lerche
parent 26b507855e
commit fbb7272cba
+2
View File
@@ -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()
}