diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 22ac453..104e342 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -24,7 +24,7 @@ jobs: - name: Build run: cargo build --verbose - name: Run tests - run: cargo test --verbose + run: cargo test --release --verbose - name: Run check run: cargo check --verbose - name: Run clippy diff --git a/Cargo.toml b/Cargo.toml index 0b02e85..808066f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ description = "A flexible rule-based file and folder comparison tool and crate i repository = "https://github.com/VolumeGraphics/havocompare" homepage = "https://github.com/VolumeGraphics/havocompare" documentation = "https://docs.rs/havocompare" -version = "0.3.0-beta1" +version = "0.3.0" edition = "2021" license = "MIT" authors = ["Volume Graphics GmbH"] @@ -27,7 +27,7 @@ schemars_derive = "0.8" thiserror = "1.0" regex = "1.6" image = "0.24" -image-compare = "0.3.0-beta1" +image-compare = "0.3.0" tracing = "0.1" tracing-subscriber = "0.3" serde_json = "1.0" diff --git a/src/image.rs b/src/image.rs index 059e3b2..8fb76dd 100644 --- a/src/image.rs +++ b/src/image.rs @@ -3,7 +3,7 @@ use schemars_derive::JsonSchema; use serde::{Deserialize, Serialize}; use std::path::{Path, PathBuf}; use thiserror::Error; -use tracing::{error, info}; +use tracing::error; #[derive(JsonSchema, Deserialize, Serialize, Debug)] /// Image comparison config options @@ -55,12 +55,9 @@ pub fn compare_paths>( let out_path = (nominal_file_name + "diff_image.png").to_string(); if result.score < config.threshold { - if let Some(color_map) = result.image.as_ref().map(|i| i.to_color_map()) { - info!("Writing diff image to: {}", out_path.as_str()); - color_map.save(PathBuf::from(&out_path))?; - } else { - error!("Algorithm did not produce compare-image, so we cannot save it."); - } + let color_map = result.image.to_color_map(); + color_map.save(PathBuf::from(&out_path))?; + let error_message = format!( "Diff for image {} was not met, expected {}, found {}", nominal_path.as_ref().to_string_lossy(),