Skip to content

Commit

Permalink
inline Bytes::len and Bytes::is_empty (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar authored and carllerche committed Jul 13, 2018
1 parent 052648c commit 890812a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/bytes.rs
Expand Up @@ -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()
}
Expand All @@ -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()
}
Expand Down

0 comments on commit 890812a

Please sign in to comment.