diff --git a/src/bytes_mut.rs b/src/bytes_mut.rs index 147484d53..3da61e1ed 100644 --- a/src/bytes_mut.rs +++ b/src/bytes_mut.rs @@ -177,7 +177,7 @@ impl BytesMut { /// assert_eq!(b.len(), 5); /// ``` #[inline] - pub fn len(&self) -> usize { + pub const fn len(&self) -> usize { self.len } @@ -192,7 +192,7 @@ impl BytesMut { /// assert!(b.is_empty()); /// ``` #[inline] - pub fn is_empty(&self) -> bool { + pub const fn is_empty(&self) -> bool { self.len == 0 } @@ -207,7 +207,7 @@ impl BytesMut { /// assert_eq!(b.capacity(), 64); /// ``` #[inline] - pub fn capacity(&self) -> usize { + pub const fn capacity(&self) -> usize { self.cap }