From a198a047c6ac7985b838b98bb5f0fdf32a328cd5 Mon Sep 17 00:00:00 2001 From: Devon Sawatsky Date: Mon, 27 Sep 2021 21:10:43 -0700 Subject: genericize quantizer --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index f1b23fa..cbd9c43 100644 --- a/src/main.rs +++ b/src/main.rs @@ -49,7 +49,10 @@ fn main() { image.save(outname).expect("Failed to write out"); } -fn quantize(pixels: Pixels>) -> Vec> { +fn quantize<'a, T>(pixels: T) -> Vec> +where + T: Iterator>, +{ let mut colors: HashMap, usize> = HashMap::new(); //count pixels -- cgit 1.4.1-3-g733a5