about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/main.rs5
1 files changed, 4 insertions, 1 deletions
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<Rgb<u8>>) -> Vec<Rgb<u8>> {
+fn quantize<'a, T>(pixels: T) -> Vec<Rgb<u8>>
+where
+    T: Iterator<Item = &'a Rgb<u8>>,
+{
     let mut colors: HashMap<Rgb<u8>, usize> = HashMap::new();
 
     //count pixels