diff --git a/src/main.rs b/src/main.rs index 23c4de5..08e2da4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,5 @@ -use std::fmt; use std::collections::HashMap; +use std::fmt; const IMAGE_DIMENSION_SD: usize = 8; const IMAGE_DIMENSION_HD: usize = 16; @@ -190,7 +190,7 @@ fn test_image_from_string() { } fn image_to_string(image: Image) -> String { - image_to_string_opts(image, true) + image_to_string_opts(image, false) } fn image_to_string_opts(image: Image, hd: bool) -> String { @@ -199,7 +199,7 @@ fn image_to_string_opts(image: Image, hd: bool) -> String { for line in image.pixels.chunks(chunk_size) { for pixel in line { - string.push(*pixel as char); + string.push_str(&format!("{}", *pixel)); } string.push('\n'); }