Skip to content

Commit

Permalink
const-ify Bytes::len and Bytes::is_empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyborus04 committed Nov 6, 2021
1 parent ebc61e5 commit 55bd0cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ impl Bytes {
/// assert_eq!(b.len(), 5);
/// ```
#[inline]
pub fn len(&self) -> usize {
pub const fn len(&self) -> usize {
self.len
}

Expand All @@ -194,7 +194,7 @@ impl Bytes {
/// assert!(b.is_empty());
/// ```
#[inline]
pub fn is_empty(&self) -> bool {
pub const fn is_empty(&self) -> bool {
self.len == 0
}

Expand Down

0 comments on commit 55bd0cc

Please sign in to comment.