From d946ef2e91651a4d73a04b48715ecf0cde6db75d Mon Sep 17 00:00:00 2001 From: Cyborus04 <87248184+Cyborus04@users.noreply.github.com> Date: Tue, 9 Nov 2021 05:41:40 -0500 Subject: `const`-ify `Bytes::len` and `Bytes::is_empty` (#514) --- src/bytes.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/bytes.rs b/src/bytes.rs index d0be0d2..c4fbd4a 100644 --- a/src/bytes.rs +++ b/src/bytes.rs @@ -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 } @@ -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 } -- cgit v1.2.3