mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2024-12-13 14:12:31 +00:00
Clippy
Signed-off-by: Serial <69764315+Serial-ATA@users.noreply.github.com>
This commit is contained in:
parent
cb725e882d
commit
08ec8fca3a
3 changed files with 6 additions and 8 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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<()> {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue