From ba894a7e4487f498011033808d792b32a0165218 Mon Sep 17 00:00:00 2001 From: Christopher Regali Date: Fri, 1 Mar 2024 22:39:45 +0100 Subject: [PATCH] Fix merge suggestion --- src/image.rs | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/image.rs b/src/image.rs index 13758be..c74c394 100644 --- a/src/image.rs +++ b/src/image.rs @@ -4,7 +4,7 @@ use image::{DynamicImage, Rgb}; use image_compare::{Algorithm, Metric, Similarity}; use schemars_derive::JsonSchema; use serde::{Deserialize, Serialize}; -use std::path::{Path, PathBuf}; +use std::path::Path; use thiserror::Error; use tracing::error; @@ -178,12 +178,6 @@ pub fn compare_paths>( } }; - let nominal_file_name = - get_file_name(nominal_path.as_ref()).ok_or(Error::FileNameParsing(format!( - "Could not extract filename from path {:?}", - nominal_path.as_ref() - )))?; - let out_path = (nominal_file_name + "diff_image.png").to_string(); let mut result_diff = report::Difference::new_for_file(&nominal_path, &actual_path); if result.score < config.threshold { let out_path_set = if let Some(i) = result.image { @@ -199,15 +193,6 @@ pub fn compare_paths>( None }; - if result.score < config.threshold { - let out_path_set; - if let Some(i) = result.image { - i.save(PathBuf::from(&out_path))?; - out_path_set = Some(out_path); - } else { - out_path_set = None; - } - let error_message = format!( "Diff for image {} was not met, expected {}, found {}", nominal_path.as_ref().to_string_lossy(),