From 1904e577466638900b9c3f8901a302b1106f42b6 Mon Sep 17 00:00:00 2001 From: Jovansonlee Cesar Date: Tue, 18 Jul 2017 15:21:58 +0800 Subject: [PATCH 1/2] Use unicode block for rendering of string qr --- src/render/string.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/render/string.rs b/src/render/string.rs index 584684f..0dec67f 100644 --- a/src/render/string.rs +++ b/src/render/string.rs @@ -11,7 +11,7 @@ pub trait Element: Copy { impl Element for char { fn default_color(color: Color) -> Self { - color.select('#', ' ') + color.select('█', ' ') } fn strlen(self) -> usize { @@ -25,7 +25,7 @@ impl Element for char { impl<'a> Element for &'a str { fn default_color(color: Color) -> Self { - color.select("#", " ") + color.select("█", " ") } fn strlen(self) -> usize { From fc2d2a1f6b703f8a9aa6a5fe7ade48be037b051b Mon Sep 17 00:00:00 2001 From: Jovansonlee Cesar Date: Tue, 18 Jul 2017 16:04:36 +0800 Subject: [PATCH 2/2] Fix render to string test case --- src/render/string.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/render/string.rs b/src/render/string.rs index 0dec67f..bc92831 100644 --- a/src/render/string.rs +++ b/src/render/string.rs @@ -106,7 +106,7 @@ fn test_render_to_string() { Color::Light, Color::Dark, ]; let image: String = Renderer::::new(colors, 2, 1).build(); - assert_eq!(&image, " \n # \n # \n "); + assert_eq!(&image, " \n █ \n █ \n "); let image2 = Renderer::new(colors, 2, 1) .light_color("A")