allow len without is_empty

This commit is contained in:
MaxOhn
2022-08-02 18:06:52 +02:00
parent d81a8c9ab6
commit 836c2e3861
5 changed files with 5 additions and 0 deletions
+1
View File
@@ -132,6 +132,7 @@ pub struct CatchStrains {
impl CatchStrains { impl CatchStrains {
/// Returns the number of strain peaks per skill. /// Returns the number of strain peaks per skill.
#[inline] #[inline]
#[allow(clippy::len_without_is_empty)]
pub fn len(&self) -> usize { pub fn len(&self) -> usize {
self.movement.len() self.movement.len()
} }
+1
View File
@@ -332,6 +332,7 @@ impl Strains {
/// Returns the number of strain peaks per skill. /// Returns the number of strain peaks per skill.
#[inline] #[inline]
#[allow(clippy::len_without_is_empty)]
pub fn len(&self) -> usize { pub fn len(&self) -> usize {
match self { match self {
Strains::Catch(strains) => strains.len(), Strains::Catch(strains) => strains.len(),
+1
View File
@@ -123,6 +123,7 @@ pub struct ManiaStrains {
impl ManiaStrains { impl ManiaStrains {
/// Returns the number of strain peaks per skill. /// Returns the number of strain peaks per skill.
#[inline] #[inline]
#[allow(clippy::len_without_is_empty)]
pub fn len(&self) -> usize { pub fn len(&self) -> usize {
self.strains.len() self.strains.len()
} }
+1
View File
@@ -219,6 +219,7 @@ pub struct OsuStrains {
impl OsuStrains { impl OsuStrains {
/// Returns the number of strain peaks per skill. /// Returns the number of strain peaks per skill.
#[inline] #[inline]
#[allow(clippy::len_without_is_empty)]
pub fn len(&self) -> usize { pub fn len(&self) -> usize {
self.aim.len() self.aim.len()
} }
+1
View File
@@ -170,6 +170,7 @@ pub struct TaikoStrains {
impl TaikoStrains { impl TaikoStrains {
/// Returns the number of strain peaks per skill. /// Returns the number of strain peaks per skill.
#[inline] #[inline]
#[allow(clippy::len_without_is_empty)]
pub fn len(&self) -> usize { pub fn len(&self) -> usize {
self.color.len() self.color.len()
} }