From 41a08d7a61d5bb8070953a93e2b53a19f7b98f85 Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Sat, 25 Apr 2020 14:18:09 +0100 Subject: [PATCH] debug message for bad pixels --- src/image.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/image.rs b/src/image.rs index 4106990..38d7edd 100644 --- a/src/image.rs +++ b/src/image.rs @@ -12,7 +12,9 @@ impl From for Image { let pixels = &pixels[1..(pixels.len() - 1)]; let pixels: Vec = pixels .iter() - .map(|&pixel| pixel.parse::().unwrap()) + .map(|&pixel| + pixel.parse::().expect(&format!("Bad pixel in image: {}\n", pixel)) + ) .collect(); Image { pixels }