diff --git a/src/components/logic/aiff.rs b/src/components/logic/aiff.rs index b0f2f9cf..370006af 100644 --- a/src/components/logic/aiff.rs +++ b/src/components/logic/aiff.rs @@ -124,13 +124,10 @@ pub(crate) fn write_to( file_bytes.splice(single_value.0..single_value.1, text_chunks); }, (title, author, copyright) => { - let items: Vec<(usize, usize)> = vec![title, author, copyright] - .iter() - .filter(|i| i.is_some()) - .map(|v| v.unwrap()) - .collect(); + let items = vec![title, author, copyright]; + let remaining: Vec<&(usize, usize)> = items.iter().flatten().collect(); - if let (Some(first), Some(last)) = (items.iter().min(), items.iter().max()) { + if let (Some(first), Some(last)) = (remaining.iter().min(), remaining.iter().max()) { file_bytes.drain(last.0..last.1); file_bytes.splice(first.0..first.1, text_chunks); } diff --git a/src/components/tags/mp4_tag.rs b/src/components/tags/mp4_tag.rs index f5b439df..f0911a7b 100644 --- a/src/components/tags/mp4_tag.rs +++ b/src/components/tags/mp4_tag.rs @@ -243,7 +243,7 @@ impl AudioTagEdit for Mp4Tag { impl AudioTagWrite for Mp4Tag { fn write_to(&self, file: &mut File) -> Result<()> { - self.inner.write_to(&file)?; + self.inner.write_to(file)?; Ok(()) } fn write_to_path(&self, path: &str) -> Result<()> { diff --git a/src/lib.rs b/src/lib.rs index 97565ec1..e5dccf74 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -118,7 +118,8 @@ clippy::must_use_candidate, clippy::doc_markdown, clippy::let_underscore_drop, - clippy::match_wildcard_for_single_variants + clippy::match_wildcard_for_single_variants, + clippy::semicolon_if_nothing_returned )] mod types;