From d1f2ff5556153d951955919f7745e0a9aef061a6 Mon Sep 17 00:00:00 2001 From: SirTalksalot75 <132705706+SirTalksalot75@users.noreply.github.com> Date: Sat, 17 Jun 2023 13:55:26 +0200 Subject: [PATCH] Update mod.rs --- src/Feature/mod.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Feature/mod.rs b/src/Feature/mod.rs index 1e94545..9507bce 100644 --- a/src/Feature/mod.rs +++ b/src/Feature/mod.rs @@ -1,3 +1,5 @@ +use std::sync::Arc; + #[derive(Debug, Clone, Serialize, Deserialize)] enum FeatureResult { /// A boolean. Just a boolean @@ -37,7 +39,7 @@ impl PartialEq for FeatureResult { } } -type FeatureGenerator = Box) -> (String, FeatureResult)>; +type FeatureGenerator = Box>) -> (String, FeatureResult)>; #[derive(Serialize, Deserialize, Default)] struct Database { @@ -79,7 +81,7 @@ impl Database { } } -fn average_luminance(image: Image) -> (String, FeatureResult) { +fn average_luminance(image: Arc>) -> (String, FeatureResult) { let num_pixels = image.pixels.len() as u32; let total_brightness: f32 = image.pixels .iter() @@ -92,7 +94,7 @@ fn average_luminance(image: Image) -> (String, FeatureResult) { (feature_name, feature_result) } -fn compare_Dim(image0: Image, image1: Image) -> (String, FeatureResult) { +fn compare_Dim(image0: Arc>, image1: Arc>) -> (String, FeatureResult) { let a = image0.width as f32 / image0.height as f32; let b = image1.width as f32 / image1.height as f32; let equal = a == b;