From 6c355b0c839abc7500b478d7a9fa9e1b813fb769 Mon Sep 17 00:00:00 2001 From: Joshua Holmer Date: Fri, 19 Feb 2016 15:24:43 -0500 Subject: [PATCH] OH MY GOSH A TEST PASSED --- src/png.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/png.rs b/src/png.rs index ecb06328..2fff074c 100644 --- a/src/png.rs +++ b/src/png.rs @@ -886,7 +886,7 @@ fn reduce_palette_to_grayscale(png: &PngData) -> Option> { // At the end of each pixel, push its grayscale value onto the reduced image cur_pixel.push(bit); if cur_pixel.len() == bit_depth { - let palette_idx: usize = ((cur_pixel.to_bytes()[0]) * 3) as usize; + let palette_idx: usize = cur_pixel.to_bytes()[0] as usize * 3; reduced.extend(BitVec::from_bytes(&[palette[palette_idx]])); // BitVec's clear function doesn't set len to 0 cur_pixel = BitVec::with_capacity(bit_depth);