Skip to content

Commit 630fc1f

Browse files
committed
Remove len and is_empty from impl_array_newtype macros
An array in Rust has no concept of length, it is a fixed size data type. Equally an array cannot be "empty", again since it is a fixed size data type. These are methods/concepts seen in slices and vectors. Remove the `len` and `is_empty` methods.
1 parent 9788b6d commit 630fc1f

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

secp256k1-sys/src/macros.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,6 @@ macro_rules! impl_array_newtype {
1919
($thing:ident, $ty:ty, $len:expr) => {
2020
impl Copy for $thing {}
2121

22-
impl $thing {
23-
/// Returns the length of the object as an array.
24-
#[inline]
25-
pub fn len(&self) -> usize { $len }
26-
27-
/// Returns whether the object as an array is empty.
28-
#[inline]
29-
pub fn is_empty(&self) -> bool { false }
30-
}
31-
3222
impl AsRef<[$ty; $len]> for $thing {
3323
#[inline]
3424
/// Gets a reference to the underlying array

src/macros.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,6 @@ macro_rules! impl_array_newtype {
1919
($thing:ident, $ty:ty, $len:expr) => {
2020
impl Copy for $thing {}
2121

22-
impl $thing {
23-
/// Returns the length of the object as an array.
24-
#[inline]
25-
pub fn len(&self) -> usize { $len }
26-
27-
/// Returns whether the object as an array is empty.
28-
#[inline]
29-
pub fn is_empty(&self) -> bool { false }
30-
}
31-
3222
impl AsRef<[$ty; $len]> for $thing {
3323
#[inline]
3424
/// Gets a reference to the underlying array

0 commit comments

Comments
 (0)