Skip to content

Commit 5d913fd

Browse files
committed
riff: fix clippy nightly warnings
1 parent 0ebaeec commit 5d913fd

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

symphonia-format-riff/src/aiff/chunks.rs

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,7 @@ impl ParseChunk for CommonChunk {
152152
let sample_rate = Extended::from_be_bytes(sample_rate);
153153
let sample_rate = sample_rate.to_f64() as u32;
154154

155-
let format_data = Self::read_pcm_fmt(sample_size as u16, n_channels as u16);
156-
157-
let format_data = match format_data {
158-
Ok(data) => data,
159-
Err(e) => return Err(e),
160-
};
155+
let format_data = Self::read_pcm_fmt(sample_size as u16, n_channels as u16)?;
161156

162157
Ok(CommonChunk { n_channels, n_sample_frames, sample_size, sample_rate, format_data })
163158
}
@@ -237,20 +232,15 @@ impl CommonChunkParser for ChunkParser<CommonChunk> {
237232
}
238233

239234
let format_data = match &compression_type {
240-
b"none" | b"NONE" => CommonChunk::read_pcm_fmt(sample_size as u16, n_channels as u16),
241-
b"alaw" | b"ALAW" => CommonChunk::read_alaw_pcm_fmt(n_channels as u16),
242-
b"ulaw" | b"ULAW" => CommonChunk::read_mulaw_pcm_fmt(n_channels as u16),
243-
b"fl32" | b"fl64" => CommonChunk::read_ieee_fmt(sample_size as u16, n_channels as u16),
244-
b"sowt" | b"SOWT" => CommonChunk::read_sowt_fmt(sample_size as u16, n_channels as u16),
245-
b"twos" | b"TWOS" => CommonChunk::read_twos_fmt(sample_size as u16, n_channels as u16),
235+
b"none" | b"NONE" => CommonChunk::read_pcm_fmt(sample_size as u16, n_channels as u16)?,
236+
b"alaw" | b"ALAW" => CommonChunk::read_alaw_pcm_fmt(n_channels as u16)?,
237+
b"ulaw" | b"ULAW" => CommonChunk::read_mulaw_pcm_fmt(n_channels as u16)?,
238+
b"fl32" | b"fl64" => CommonChunk::read_ieee_fmt(sample_size as u16, n_channels as u16)?,
239+
b"sowt" | b"SOWT" => CommonChunk::read_sowt_fmt(sample_size as u16, n_channels as u16)?,
240+
b"twos" | b"TWOS" => CommonChunk::read_twos_fmt(sample_size as u16, n_channels as u16)?,
246241
_ => return unsupported_error("aifc: Compression type not implemented"),
247242
};
248243

249-
let format_data = match format_data {
250-
Ok(data) => data,
251-
Err(e) => return Err(e),
252-
};
253-
254244
Ok(CommonChunk { n_channels, n_sample_frames, sample_size, sample_rate, format_data })
255245
}
256246
}

0 commit comments

Comments
 (0)