From cf5ec121da8ab9660aa1dbfc7056c2b562627d06 Mon Sep 17 00:00:00 2001 From: Ian Hobson Date: Fri, 12 May 2023 16:52:06 +0200 Subject: [PATCH] clippy: Avoid unnecessary closures --- src/fmt.rs | 2 +- src/wavereader.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fmt.rs b/src/fmt.rs index f29aabc..5892638 100644 --- a/src/fmt.rs +++ b/src/fmt.rs @@ -105,7 +105,7 @@ impl ChannelMask { (0..18) .map(|i| 1 << i) .filter(|mask| mask & input_mask > 0) - .map(|mask| Into::::into(mask)) + .map(ChannelMask::from) .collect() } } diff --git a/src/wavereader.rs b/src/wavereader.rs index 92af0f3..73989b2 100644 --- a/src/wavereader.rs +++ b/src/wavereader.rs @@ -585,7 +585,7 @@ impl WaveReader { Ok((start, length)) => { buffer.resize(length as usize, 0x0); self.inner.seek(SeekFrom::Start(start))?; - self.inner.read(buffer).map_err(|e| ParserError::IOError(e)) + self.inner.read(buffer).map_err(ParserError::IOError) } Err(ParserError::ChunkMissing { signature: _ }) => Ok(0), Err(any) => Err(any),