From a452467e064a7a5be5bc1a4ba7eeb88219dd50b1 Mon Sep 17 00:00:00 2001 From: Ezinwa Okpoechi Date: Thu, 24 May 2018 12:05:33 +0200 Subject: [PATCH] Remove unnecessary space if there are no decorations --- src/printer.rs | 4 ++-- tests/snapshots/output/grid,header.snapshot.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/printer.rs b/src/printer.rs index 900d9206..c0922163 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -84,11 +84,11 @@ impl<'a> Printer<'a> { write!( self.handle, - "{}{} ", + "{}{}", " ".repeat(self.panel_width), self.colors .grid - .paint(if self.panel_width > 0 { "│" } else { "" }), + .paint(if self.panel_width > 0 { "│ " } else { "" }), )?; } else { write!(self.handle, "{}", " ".repeat(self.panel_width))?; diff --git a/tests/snapshots/output/grid,header.snapshot.txt b/tests/snapshots/output/grid,header.snapshot.txt index 00b176b7..50c16941 100644 --- a/tests/snapshots/output/grid,header.snapshot.txt +++ b/tests/snapshots/output/grid,header.snapshot.txt @@ -1,5 +1,5 @@ ──────────────────────────────────────────────────────────────────────────────── - File: sample.rs +File: sample.rs ──────────────────────────────────────────────────────────────────────────────── struct Rectangle { width: u32,