clippy: Avoid making unnecessary references

This commit is contained in:
Ian Hobson
2023-05-12 16:52:06 +02:00
parent 566ad07247
commit 651009c96a
3 changed files with 10 additions and 12 deletions

View File

@@ -579,15 +579,13 @@ impl<R: Read + Seek> WaveReader<R> {
&mut self,
ident: FourCC,
at: u32,
mut buffer: &mut Vec<u8>,
buffer: &mut Vec<u8>,
) -> Result<usize, ParserError> {
match self.get_chunk_extent_at_index(ident, at) {
Ok((start, length)) => {
buffer.resize(length as usize, 0x0);
self.inner.seek(SeekFrom::Start(start))?;
self.inner
.read(&mut buffer)
.map_err(|e| ParserError::IOError(e))
self.inner.read(buffer).map_err(|e| ParserError::IOError(e))
}
Err(ParserError::ChunkMissing { signature: _ }) => Ok(0),
Err(any) => Err(any),