Skip to content

Commit

Permalink
remove let-else statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Billy Messenger authored and Billy Messenger committed Jan 3, 2024
1 parent 097da2c commit 87656b1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/read/read_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ fn copy_block_into_read_buffer<T: Copy + Default + Send>(
}
};

let Some(block) = maybe_block else {
if maybe_block.is_none() {
// If no block exists, output silence.
for buffer_ch in heap.read_buffer.block.iter_mut() {
buffer_ch.resize(buffer_ch.len() + frames, Default::default());
Expand All @@ -919,6 +919,8 @@ fn copy_block_into_read_buffer<T: Copy + Default + Send>(
return;
};

let block = maybe_block.unwrap();

for (buffer_ch, block_ch) in heap.read_buffer.block.iter_mut().zip(block.block.iter()) {
// If for some reason the decoder did not fill this block fully,
// fill the rest with zeros.
Expand Down

0 comments on commit 87656b1

Please sign in to comment.