Skip to content

Commit

Permalink
riff: fix clippy nightly warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sscobici committed Dec 27, 2024
1 parent 0ebaeec commit 5d913fd
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions symphonia-format-riff/src/aiff/chunks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,7 @@ impl ParseChunk for CommonChunk {
let sample_rate = Extended::from_be_bytes(sample_rate);
let sample_rate = sample_rate.to_f64() as u32;

let format_data = Self::read_pcm_fmt(sample_size as u16, n_channels as u16);

let format_data = match format_data {
Ok(data) => data,
Err(e) => return Err(e),
};
let format_data = Self::read_pcm_fmt(sample_size as u16, n_channels as u16)?;

Ok(CommonChunk { n_channels, n_sample_frames, sample_size, sample_rate, format_data })
}
Expand Down Expand Up @@ -237,20 +232,15 @@ impl CommonChunkParser for ChunkParser<CommonChunk> {
}

let format_data = match &compression_type {
b"none" | b"NONE" => CommonChunk::read_pcm_fmt(sample_size as u16, n_channels as u16),
b"alaw" | b"ALAW" => CommonChunk::read_alaw_pcm_fmt(n_channels as u16),
b"ulaw" | b"ULAW" => CommonChunk::read_mulaw_pcm_fmt(n_channels as u16),
b"fl32" | b"fl64" => CommonChunk::read_ieee_fmt(sample_size as u16, n_channels as u16),
b"sowt" | b"SOWT" => CommonChunk::read_sowt_fmt(sample_size as u16, n_channels as u16),
b"twos" | b"TWOS" => CommonChunk::read_twos_fmt(sample_size as u16, n_channels as u16),
b"none" | b"NONE" => CommonChunk::read_pcm_fmt(sample_size as u16, n_channels as u16)?,
b"alaw" | b"ALAW" => CommonChunk::read_alaw_pcm_fmt(n_channels as u16)?,
b"ulaw" | b"ULAW" => CommonChunk::read_mulaw_pcm_fmt(n_channels as u16)?,
b"fl32" | b"fl64" => CommonChunk::read_ieee_fmt(sample_size as u16, n_channels as u16)?,
b"sowt" | b"SOWT" => CommonChunk::read_sowt_fmt(sample_size as u16, n_channels as u16)?,
b"twos" | b"TWOS" => CommonChunk::read_twos_fmt(sample_size as u16, n_channels as u16)?,
_ => return unsupported_error("aifc: Compression type not implemented"),
};

let format_data = match format_data {
Ok(data) => data,
Err(e) => return Err(e),
};

Ok(CommonChunk { n_channels, n_sample_frames, sample_size, sample_rate, format_data })
}
}
Expand Down

0 comments on commit 5d913fd

Please sign in to comment.