Fix new clippy lints

This commit is contained in:
Josh Holmer 2023-04-03 23:30:28 -04:00
parent fd5027a017
commit 5341de2163

View file

@ -361,7 +361,7 @@ pub fn optimize(input: &InFile, output: &OutFile, opts: &Options) -> PngResult<(
info!("File already optimized");
match (output, input) {
// if p is None, it also means same as the input path
(&OutFile::Path(ref p), &InFile::Path(ref input_path))
(OutFile::Path(ref p), InFile::Path(ref input_path))
if p.as_ref().map_or(true, |p| p == input_path) =>
{
return Ok(());
@ -384,7 +384,7 @@ pub fn optimize(input: &InFile, output: &OutFile, opts: &Options) -> PngResult<(
.write_all(&optimized_output)
.map_err(|e| PngError::new(&format!("Unable to write to stdout: {}", e)))?;
}
(&OutFile::Path(ref output_path), _) => {
(OutFile::Path(ref output_path), _) => {
let output_path = output_path
.as_ref()
.map(|p| p.as_path())