Clippy: Apply lints across projects

This commit is contained in:
Serial 2023-03-13 20:20:46 -04:00 committed by Alex
parent 424a2c8d4c
commit 7ac4ab4cbd
5 changed files with 9 additions and 14 deletions

View file

@ -54,5 +54,5 @@ fn main() {
println!("Sample Rate: {}", properties.sample_rate().unwrap_or(0));
println!("Bit depth: {}", properties.bit_depth().unwrap_or(0));
println!("Channels: {}", properties.channels().unwrap_or(0));
println!("Duration: {}", duration_display);
println!("Duration: {duration_display}");
}

View file

@ -23,7 +23,7 @@ fn main() {
for (num, tag) in tags.iter().enumerate() {
let tag_type = tag.tag_type();
println!("{}: {:?}", num, tag_type);
println!("{num}: {tag_type:?}");
available_tag_types.push(tag_type);
}
@ -51,7 +51,7 @@ fn main() {
let tag_remove = available_tag_types[to_remove.unwrap()];
if tag_remove.remove_from_path(path).is_ok() {
println!("INFO: Removed tag: `{:?}`", tag_remove);
println!("INFO: Removed tag: `{tag_remove:?}`");
} else {
eprintln!("ERROR: Failed to remove the tag")
}

View file

@ -39,10 +39,7 @@ fn main() {
} else {
let tag_type = tagged_file.primary_tag_type();
eprintln!(
"WARN: No tags found, creating a new tag of type `{:?}`",
tag_type
);
eprintln!("WARN: No tags found, creating a new tag of type `{tag_type:?}`");
tagged_file.insert_tag(Tag::new(tag_type));
tagged_file.primary_tag_mut().unwrap()

View file

@ -1633,7 +1633,7 @@ mod tests {
assert_eq!(20, tag.len());
let id3v2 = ID3v2Tag::from(tag.clone());
let (split_remainder, split_tag) = id3v2.clone().split_tag();
let (split_remainder, split_tag) = id3v2.split_tag();
assert_eq!(0, split_remainder.0.len());
assert_eq!(tag.len(), split_tag.len());
@ -1772,7 +1772,7 @@ mod tests {
value: FrameValue::UserText(EncodedTextFrame {
description: String::from("FOO_BAR"),
encoding: TextEncoding::UTF8, // Not considered by PartialEq!
content: Default::default(), // Not considered by PartialEq!
content: String::new(), // Not considered by PartialEq!
}),
flags: FrameFlags::default(),
})

View file

@ -7,11 +7,9 @@ fn crash1() {
let reader =
get_reader("pictureinformation_from_jpeg/crash-e46c53f85ca87dd374bc5c4e73c2f66f3a45b955");
match PictureInformation::from_jpeg(reader.get_ref())
.unwrap_err()
.kind()
{
let err = PictureInformation::from_jpeg(reader.get_ref()).unwrap_err();
match err.kind() {
ErrorKind::NotAPicture => {},
e => panic!("Received an unexpected error: {:?}", e),
_ => panic!("Received an unexpected error: {err}"),
}
}