aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Cyborus04 <87248184+Cyborus04@users.noreply.github.com> 2021-11-09 05:41:40 -0500
committerGravatar GitHub <noreply@github.com> 2021-11-09 11:41:40 +0100
commitd946ef2e91651a4d73a04b48715ecf0cde6db75d (patch)
treeb8c905caf1ec0a93b63b1a9e6babcb2eb11a8132 /src
parentba5c5c93affe9386dd052c5236cad83057f9a81d (diff)
downloadbytes-d946ef2e91651a4d73a04b48715ecf0cde6db75d.tar.gz
bytes-d946ef2e91651a4d73a04b48715ecf0cde6db75d.tar.zst
bytes-d946ef2e91651a4d73a04b48715ecf0cde6db75d.zip
`const`-ify `Bytes::len` and `Bytes::is_empty` (#514)
Diffstat (limited to 'src')
-rw-r--r--src/bytes.rs4
1 files changed, 2 insertions, 2 deletions
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
}