column width
This commit is contained in:
parent
fb0fac0665
commit
aa8ac251f6
|
@ -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 }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue