debug message for bad pixels

This commit is contained in:
Max Bradbury 2020-04-25 14:18:09 +01:00
parent f18b0de251
commit 41a08d7a61
1 changed files with 3 additions and 1 deletions

View File

@ -12,7 +12,9 @@ impl From<String> for Image {
let pixels = &pixels[1..(pixels.len() - 1)];
let pixels: Vec<u32> = pixels
.iter()
.map(|&pixel| pixel.parse::<u32>().unwrap())
.map(|&pixel|
pixel.parse::<u32>().expect(&format!("Bad pixel in image: {}\n", pixel))
)
.collect();
Image { pixels }