From a7b99f4f205531f7f8a793af1e6d53445bf718ad Mon Sep 17 00:00:00 2001 From: Devon Sawatsky Date: Mon, 27 Sep 2021 19:16:53 -0700 Subject: cleanup, update dependencies --- src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 9513a62..eda43c9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,12 +1,12 @@ -use std::{cmp::Ordering, collections::HashMap, env::args, time::Instant}; +use std::{collections::HashMap, env::args, time::Instant}; use image::io::Reader as ImageReader; use image::Rgb; fn main() { let before = Instant::now(); - let filename = std::env::args().skip(1).next().unwrap(); - let outname = std::env::args().skip(2).next().unwrap(); + let filename = args().nth(1).unwrap(); + let outname = args().nth(2).unwrap(); // The percent of RGB value difference a color has to surpass to be considere unique let tolerance = 0.6; let rgb_tolerance = 10.0 * tolerance; @@ -149,6 +149,7 @@ fn rgb_difference(a: &Rgb, z: &Rgb) -> f64 { (((c - f) * (c - f)) + ((a - d).abs() / 90.0) + (b - e).abs()) as f64 } +#[warn(clippy::float_cmp)] fn pixel_rgb_to_hsv(a: &Rgb) -> (f32, f32, f32) { let (r, g, b) = ( a.0[0] as f32 / 256.0, -- cgit 1.4.1-3-g733a5