diff --git a/crates/oxc_data_structures/src/stack/non_empty.rs b/crates/oxc_data_structures/src/stack/non_empty.rs index 170a8820a57273..2dfd332b4837b2 100644 --- a/crates/oxc_data_structures/src/stack/non_empty.rs +++ b/crates/oxc_data_structures/src/stack/non_empty.rs @@ -290,15 +290,11 @@ impl NonEmptyStack { /// /// Number of entries is always at least 1. Stack is never empty. #[inline] + #[expect(clippy::len_without_is_empty)] // `is_empty` method is pointless. It's never empty. pub fn len(&self) -> usize { >::len(self) } - #[inline] - pub fn is_empty(&self) -> bool { - self.len() == 0 - } - /// Get capacity. #[inline] pub fn capacity(&self) -> usize { diff --git a/crates/oxc_data_structures/src/stack/sparse.rs b/crates/oxc_data_structures/src/stack/sparse.rs index 3814fac10942dd..847d05c62f3522 100644 --- a/crates/oxc_data_structures/src/stack/sparse.rs +++ b/crates/oxc_data_structures/src/stack/sparse.rs @@ -187,15 +187,11 @@ impl SparseStack { /// /// Number of entries is always at least 1. Stack is never empty. #[inline] + #[expect(clippy::len_without_is_empty)] // `is_empty` method is pointless. It's never empty. pub fn len(&self) -> usize { self.has_values.len() } - #[inline] - pub fn is_empty(&self) -> bool { - self.has_values.len() == 0 - } - /// Get capacity of stack for any entries (either `Some` or `None`). /// /// Capacity is always at least 1. Stack is never empty.