From 89d8962b23cd63ca7e181a35fdc8e4051eb7da49 Mon Sep 17 00:00:00 2001 From: Luracasmus <77991691+Luracasmus@users.noreply.github.com> Date: Sat, 22 Nov 2025 20:14:41 +0100 Subject: [PATCH] Apply `clippy::map_unwrap_or` --- src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 44efbaa7..d2c0bf5d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -275,8 +275,7 @@ pub fn optimize(input: &InFile, output: &OutFile, opts: &Options) -> PngResult<( (OutFile::Path { path, .. }, _) => { let output_path = path .as_ref() - .map(PathBuf::as_path) - .unwrap_or_else(|| input.path().unwrap()); + .map_or_else(|| input.path().unwrap(), PathBuf::as_path); let out_file = File::create(output_path) .map_err(|err| PngError::WriteFailed(output_path.display().to_string(), err))?; if let Some(metadata_input) = &opt_metadata_preserved {