Skip to content

Commit

Permalink
Take care of clippy warning on nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
noeddl committed May 7, 2024
1 parent de88b5a commit fd9478a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/voicing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit fd9478a

Please sign in to comment.