Apply clippy::unnecessary_semicolon

This commit is contained in:
Luracasmus 2025-11-22 19:14:26 +01:00 committed by Alejandro González
parent 285b0aae10
commit 93da9c7f04
No known key found for this signature in database
13 changed files with 20 additions and 20 deletions

View file

@ -7,7 +7,7 @@ pub fn deflate(data: &[u8], options: zopfli::Options) -> PngResult<Vec<u8>> {
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)
}

View file

@ -529,7 +529,7 @@ fn perform_trials(
trace!(">{bytes} bytes");
}
Err(_) => (),
};
}
}
return Some(result);
}

View file

@ -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",

View file

@ -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;

View file

@ -81,7 +81,7 @@ pub fn reduced_alpha_channel(png: &PngImage, optimize_alpha: bool) -> Option<Png
raw_data.resize(raw_data.len() + colored_bytes, trns);
}
_ => raw_data.extend_from_slice(&pixel[0..colored_bytes]),
};
}
}
// Construct the color type with appropriate transparency data

View file

@ -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());

View file

@ -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());

View file

@ -50,7 +50,7 @@ fn test_it_converts_callbacks<CBPRE, CBPOST>(
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());

View file

@ -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());

View file

@ -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());

View file

@ -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());

View file

@ -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());

View file

@ -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());