From 93da9c7f04f7d6ee5636a2ede07dc6914c018362 Mon Sep 17 00:00:00 2001 From: Luracasmus <77991691+Luracasmus@users.noreply.github.com> Date: Sat, 22 Nov 2025 19:14:26 +0100 Subject: [PATCH] Apply `clippy::unnecessary_semicolon` --- src/deflate/zopfli_oxipng.rs | 2 +- src/lib.rs | 2 +- src/main.rs | 4 ++-- src/png/scan_lines.rs | 2 +- src/reduction/alpha.rs | 2 +- tests/alpha.rs | 2 +- tests/filters.rs | 2 +- tests/flags.rs | 4 ++-- tests/interlaced.rs | 2 +- tests/interlacing.rs | 2 +- tests/reduction.rs | 12 ++++++------ tests/regression.rs | 2 +- tests/strategies.rs | 2 +- 13 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/deflate/zopfli_oxipng.rs b/src/deflate/zopfli_oxipng.rs index c66a0c65..28960edf 100644 --- a/src/deflate/zopfli_oxipng.rs +++ b/src/deflate/zopfli_oxipng.rs @@ -7,7 +7,7 @@ pub fn deflate(data: &[u8], options: zopfli::Options) -> PngResult> { match zopfli::compress(options, zopfli::Format::Zlib, Box::new(data), &mut output) { Ok(_) => (), Err(_) => return Err(PngError::new("Failed to compress in zopfli")), - }; + } output.shrink_to_fit(); Ok(output) } diff --git a/src/lib.rs b/src/lib.rs index edbf33db..ee827cd7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -529,7 +529,7 @@ fn perform_trials( trace!(">{bytes} bytes"); } Err(_) => (), - }; + } } return Some(result); } diff --git a/src/main.rs b/src/main.rs index 052244df..92b4583c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -127,7 +127,7 @@ fn collect_files( warn!("{} is a directory, skipping", input.display()); } continue; - }; + } let out_file = if let (Some(out_dir), &OutFile::Path { preserve_attrs, .. }) = (out_dir, out_file) { let path = Some(out_dir.join(input.file_name().unwrap())); @@ -243,7 +243,7 @@ fn parse_opts_into_struct( match DirBuilder::new().recursive(true).create(path) { Ok(()) => (), Err(x) => return Err(format!("Could not create output directory {x}")), - }; + } } else if !path.is_dir() { return Err(format!( "{} is an existing file (not a directory), cannot create directory", diff --git a/src/png/scan_lines.rs b/src/png/scan_lines.rs index e19bafc8..911f72ba 100644 --- a/src/png/scan_lines.rs +++ b/src/png/scan_lines.rs @@ -138,7 +138,7 @@ impl Iterator for ScanLineRanges { pixels_per_line += 1; } _ => (), - }; + } let current_pass = Some(pass.0); if pass.1 + y_steps >= self.height { pass.0 += 1; diff --git a/src/reduction/alpha.rs b/src/reduction/alpha.rs index 04527cfd..7eda3399 100644 --- a/src/reduction/alpha.rs +++ b/src/reduction/alpha.rs @@ -81,7 +81,7 @@ pub fn reduced_alpha_channel(png: &PngImage, optimize_alpha: bool) -> Option raw_data.extend_from_slice(&pixel[0..colored_bytes]), - }; + } } // Construct the color type with appropriate transparency data diff --git a/tests/alpha.rs b/tests/alpha.rs index f86174f9..a1446d8d 100644 --- a/tests/alpha.rs +++ b/tests/alpha.rs @@ -36,7 +36,7 @@ fn test_it_converts( match oxipng::optimize(&InFile::Path(input), &output, &opts) { Ok(_) => (), Err(x) => panic!("{}", x), - }; + } let output = output.path().unwrap(); assert!(output.exists()); diff --git a/tests/filters.rs b/tests/filters.rs index 4f6f0025..6e6d39fb 100644 --- a/tests/filters.rs +++ b/tests/filters.rs @@ -38,7 +38,7 @@ fn test_it_converts( match oxipng::optimize(&InFile::Path(input), &output, &opts) { Ok(_) => (), Err(x) => panic!("{}", x), - }; + } let output = output.path().unwrap(); assert!(output.exists()); diff --git a/tests/flags.rs b/tests/flags.rs index ca2f9766..ebb9c7e7 100644 --- a/tests/flags.rs +++ b/tests/flags.rs @@ -50,7 +50,7 @@ fn test_it_converts_callbacks( match oxipng::optimize(&InFile::Path(input), output, opts) { Ok(_) => (), Err(x) => panic!("{}", x), - }; + } let output = output.path().unwrap(); assert!(output.exists()); @@ -445,7 +445,7 @@ fn preserve_attrs() { match oxipng::optimize(&InFile::Path(input), &output, &opts) { Ok(_) => (), Err(x) => panic!("{}", x), - }; + } let output = output.path().unwrap(); assert!(output.exists()); diff --git a/tests/interlaced.rs b/tests/interlaced.rs index 9fac6038..1179331d 100644 --- a/tests/interlaced.rs +++ b/tests/interlaced.rs @@ -40,7 +40,7 @@ fn test_it_converts( match oxipng::optimize(&InFile::Path(input), &output, &opts) { Ok(_) => (), Err(x) => panic!("{}", x), - }; + } let output = output.path().unwrap(); assert!(output.exists()); diff --git a/tests/interlacing.rs b/tests/interlacing.rs index 83bfcd7f..27cbc0ee 100644 --- a/tests/interlacing.rs +++ b/tests/interlacing.rs @@ -36,7 +36,7 @@ fn test_it_converts( match oxipng::optimize(&InFile::Path(input), &output, &opts) { Ok(_) => (), Err(x) => panic!("{}", x), - }; + } let output = output.path().unwrap(); assert!(output.exists()); diff --git a/tests/reduction.rs b/tests/reduction.rs index bd362dda..a9c654d7 100644 --- a/tests/reduction.rs +++ b/tests/reduction.rs @@ -41,7 +41,7 @@ fn test_it_converts( match oxipng::optimize(&InFile::Path(input), &output, &opts) { Ok(_) => (), Err(x) => panic!("{}", x), - }; + } let output = output.path().unwrap(); assert!(output.exists()); @@ -999,7 +999,7 @@ fn palette_should_be_reduced_with_dupes() { match oxipng::optimize(&InFile::Path(input), &output, &opts) { Ok(_) => (), Err(x) => panic!("{}", x), - }; + } let output = output.path().unwrap(); assert!(output.exists()); @@ -1036,7 +1036,7 @@ fn palette_should_be_reduced_with_unused() { match oxipng::optimize(&InFile::Path(input), &output, &opts) { Ok(_) => (), Err(x) => panic!("{}", x), - }; + } let output = output.path().unwrap(); assert!(output.exists()); @@ -1074,7 +1074,7 @@ fn palette_should_be_reduced_with_bkgd() { match oxipng::optimize(&InFile::Path(input), &output, &opts) { Ok(_) => (), Err(x) => panic!("{}", x), - }; + } let output = output.path().unwrap(); assert!(output.exists()); @@ -1112,7 +1112,7 @@ fn palette_should_be_reduced_with_both() { match oxipng::optimize(&InFile::Path(input), &output, &opts) { Ok(_) => (), Err(x) => panic!("{}", x), - }; + } let output = output.path().unwrap(); assert!(output.exists()); @@ -1149,7 +1149,7 @@ fn palette_should_be_reduced_with_missing() { match oxipng::optimize(&InFile::Path(input), &output, &opts) { Ok(_) => (), Err(x) => panic!("{}", x), - }; + } let output = output.path().unwrap(); assert!(output.exists()); diff --git a/tests/regression.rs b/tests/regression.rs index 16b0992e..c63a764d 100644 --- a/tests/regression.rs +++ b/tests/regression.rs @@ -42,7 +42,7 @@ fn test_it_converts( match oxipng::optimize(&InFile::Path(input), &output, &opts) { Ok(_) => (), Err(x) => panic!("{}", x), - }; + } let output = output.path().unwrap(); assert!(output.exists()); diff --git a/tests/strategies.rs b/tests/strategies.rs index e935780f..8bca7b43 100644 --- a/tests/strategies.rs +++ b/tests/strategies.rs @@ -37,7 +37,7 @@ fn test_it_converts( match oxipng::optimize(&InFile::Path(input), &output, &opts) { Ok(_) => (), Err(x) => panic!("{}", x), - }; + } let output = output.path().unwrap(); assert!(output.exists());