column width

This commit is contained in:
Max Bradbury 2020-04-11 23:24:36 +01:00
parent fb0fac0665
commit aa8ac251f6
1 changed files with 3 additions and 1 deletions

View File

@ -429,7 +429,9 @@ fn image_from_string(string: String) -> Image {
let pixels: Vec<&str> = string.split("").collect();
// the above seems to add an extra "" at the start and end of the vec, so strip them below
let pixels = &pixels[1..(pixels.len() - 1)];
let pixels: Vec<u8> = pixels.iter().map(|&pixel| { pixel.parse::<u8>().unwrap() }).collect();
let pixels: Vec<u8> = pixels.iter().map(|&pixel| {
pixel.parse::<u8>().unwrap()
}).collect();
Image { pixels }
}