Skip to content

Commit

Permalink
Removed function to enforce invariants on partition depth and number …
Browse files Browse the repository at this point in the history
…of notes in MIDI sequence, moved to utils mod.
  • Loading branch information
allthemusicllc committed Aug 28, 2019
1 parent e0b5005 commit 899709c
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/directives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@ fn parse_max_files_argument<'a>(matches: &clap::ArgMatches<'a>) -> f32 {
max_files
}

fn enforce_num_notes_partition_depth_relation(num_notes: u32, partition_depth: u32) {
if partition_depth > num_notes {
panic!("Partition depth must not be greater than the length of the provided MIDI note sequence");
}
}

/****************************/
/***** Single Directive *****/
/****************************/
Expand Down Expand Up @@ -130,7 +124,6 @@ impl<'a> From<&clap::ArgMatches<'a>> for BatchDirectiveArgs {

// Parse partition_depth argument as integer
let partition_depth = parse_partition_depth_argument(matches);
enforce_num_notes_partition_depth_relation(sequence.notes.len() as u32, partition_depth);

// Parse max_files argument and set default if not provided
let max_files = parse_max_files_argument(matches);
Expand Down Expand Up @@ -247,7 +240,6 @@ impl<'a> From<&clap::ArgMatches<'a>> for PartitionDirectiveArgs {

// Parse partition_depth argument as integer
let partition_depth = parse_partition_depth_argument(matches);
enforce_num_notes_partition_depth_relation(sequence.notes.len() as u32, partition_depth);

// Parse max_files argument and set default if not provided
let max_files = parse_max_files_argument(matches);
Expand Down

0 comments on commit 899709c

Please sign in to comment.