From fd9478a360e7d818627510d41871e7a6c170f564 Mon Sep 17 00:00:00 2001 From: Anett Seeker Date: Tue, 7 May 2024 21:25:12 +0200 Subject: [PATCH] Take care of clippy warning on nightly --- src/voicing.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/voicing.rs b/src/voicing.rs index e640240..5c58938 100644 --- a/src/voicing.rs +++ b/src/voicing.rs @@ -63,11 +63,7 @@ impl Voicing { /// Return the lowest fret at which a string is pressed down. pub fn get_min_pressed_fret(&self) -> FretID { - match self.frets().filter(|&x| x > 0).min() { - Some(x) => x, - // Special case [0, 0, 0, 0]: no string is pressed down. - _ => 0, - } + self.frets().filter(|&x| x > 0).min().unwrap_or_default() } /// Return the lowest fret involved in playing the chord voicing @@ -338,6 +334,7 @@ mod tests { #[rstest( frets, min_pressed_fret, min_fret, max_fret, span, + // Special case [0, 0, 0, 0]: no string is pressed down. case([0, 0, 0, 0], 0, 0, 0, 0), case([1, 1, 1, 1], 1, 1, 1, 1), case([2, 0, 1, 3], 1, 0, 3, 3),