From 0b9ff83f70761b12082c42f76286063d2e5e6716 Mon Sep 17 00:00:00 2001 From: Arseny Mitin Date: Mon, 26 May 2025 01:54:10 +0400 Subject: [PATCH] feat(array): const methods --- src/array.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/array.rs b/src/array.rs index d5f0a939..8979b172 100644 --- a/src/array.rs +++ b/src/array.rs @@ -56,7 +56,7 @@ where /// assert_eq!(bits.len(), 64); /// ``` #[inline] - pub fn new(data: A) -> Self { + pub const fn new(data: A) -> Self { Self { data, ..Self::ZERO } } @@ -104,7 +104,7 @@ where /// /// This method is a compile-time constant. #[inline] - pub fn len(&self) -> usize { + pub const fn len(&self) -> usize { mem::bits_of::() } @@ -112,7 +112,7 @@ where /// /// This method is a compile-time constant. #[inline] - pub fn is_empty(&self) -> bool { + pub const fn is_empty(&self) -> bool { mem::bits_of::() == 0 } }