Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
AkiyukiOkayasu committed Aug 16, 2024
1 parent 3f755a4 commit bd958cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/beep_imaadpcm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn main() {
let buf = buffer.as_mut_slice();
match player.get_next_frame(buf) {
Ok(_) => {
for (_ch, sample) in frame.iter_mut().enumerate() {
for sample in frame.iter_mut() {
*sample = buf[0].to_num::<f32>();
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/aiff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ pub(super) fn parse_aiff_header(input: &[u8]) -> IResult<&[u8], AiffHeader> {
let (input, _) = tag(b"FORM")(input)?;
let (input, size) = be_u32(input)?;
let (input, _id) = alt((tag(b"AIFF"), tag(b"AIFC")))(input)?;
Ok((input, AiffHeader { size: size }))
Ok((input, AiffHeader { size }))
}

/// 先頭のチャンクを取得する
Expand All @@ -145,7 +145,7 @@ pub(super) fn parse_comm(input: &[u8]) -> IResult<&[u8], PcmSpecs> {
let (input, bit_depth) = be_i16(input)?;
let bit_depth = bit_depth as u16;
let (input, sample_rate) = take(10usize)(input)?;
let sample_rate = extended2double(sample_rate).map_err(|e| nom::Err::from(e))? as u32;
let sample_rate = extended2double(sample_rate).map_err(nom::Err::from)? as u32;

if input.len() >= 4 {
//AIFF-C parameters
Expand Down Expand Up @@ -226,7 +226,7 @@ mod tests {
#[test]
fn extended2double_test() {
let array: [u8; 10] = [64, 14, 187, 128, 0, 0, 0, 0, 0, 0];
assert_relative_eq!(extended2double(&array), 48000.0f64);
assert_relative_eq!(extended2double(&array).unwrap(), 48000.0f64);
}

#[test]
Expand Down

0 comments on commit bd958cc

Please sign in to comment.