Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexCharlton committed Mar 28, 2023
1 parent 24d2b9b commit ec5e8d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 0 additions & 2 deletions core/src/midi_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ pub fn push_vari(x: u32, v: &mut Vec<u8>) {

#[derive(Debug, Copy, Clone)]
#[repr(u16)]
#[allow(dead_code)]
pub enum MidiFileFormat {
SingleTrack = 0,
SimultaniousTracks = 1,
Expand Down Expand Up @@ -101,7 +100,6 @@ pub struct MidiFileTrack {
/// Length of the track in ticks
pub n_ticks: u32,
}
#[allow(dead_code)]
impl MidiFileTrack {
pub fn extend_midi(&self, v: &mut Vec<u8>) {
v.extend_from_slice(b"MTrk");
Expand Down
17 changes: 9 additions & 8 deletions core/src/song_to_midi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ pub struct Config {
pub start_from: u8,
}
impl Config {
pub fn default() -> Self {
pub fn max_note_len(mut self, len_quarter: f32) -> Self {
let len = (len_quarter * TICKS_PER_QUARTER_NOTE as f32) as u32;
self.max_note_length = [len, len, len, len, len, len, len, len];
self
}
}

impl Default for Config {
fn default() -> Self {
Self {
global_transpose: 36,
max_note_length: [
Expand All @@ -31,13 +39,6 @@ impl Config {
start_from: 0,
}
}

#[allow(dead_code)]
pub fn max_note_len(mut self, len_quarter: f32) -> Self {
let len = (len_quarter * TICKS_PER_QUARTER_NOTE as f32) as u32;
self.max_note_length = [len, len, len, len, len, len, len, len];
self
}
}

#[derive(Debug)]
Expand Down

0 comments on commit ec5e8d6

Please sign in to comment.