Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
noahbaculi committed Jul 19, 2023
1 parent 870e19c commit 3fabddf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/arrangement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ pub struct Arrangement {
max_fret_span: u8,
}

// TODO! Handle duplicate pitches in the same line? BeatVec -> Hashset?
pub fn create_arrangements(
guitar: Guitar,
input_pitches: Vec<Line<BeatVec<Pitch>>>,
Expand Down
6 changes: 3 additions & 3 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,14 @@ fn parse_pitch(input_index: usize, input_line: &str) -> Result<Line<Vec<Pitch>>>
let error_msg = consecutive_indices
.into_iter()
.sorted()
.filter_map(|unmatched_input_indices| {
.map(|unmatched_input_indices| {
let first_idx = *unmatched_input_indices.first().unwrap();
let last_idx = *unmatched_input_indices.last().unwrap();
let unmatched_input = &input_line[first_idx..=last_idx];
Some(format!(
format!(
"Input '{}' on line {} could not be parsed into a pitch.",
unmatched_input, line_number
))
)
})
.collect::<Vec<_>>()
.join("\n");
Expand Down

0 comments on commit 3fabddf

Please sign in to comment.