on master help sign in
Remove unnecessary space if there are no decorations
a452467Ezinwa Okpoechi
src/printer.rs+2−2
@@ -84,11 +84,11 @@ impl<'a> Printer<'a> {
84
84
85 write!(
85 write!(
86 self.handle,
86 self.handle,
87− "{}{} ",
87+ "{}{}",
88 " ".repeat(self.panel_width),
88 " ".repeat(self.panel_width),
89 self.colors
89 self.colors
90 .grid
90 .grid
91− .paint(if self.panel_width > 0 { "│" } else { "" }),
91+ .paint(if self.panel_width > 0 { "│ " } else { "" }),
92 )?;
92 )?;
93 } else {
93 } else {
94 write!(self.handle, "{}", " ".repeat(self.panel_width))?;
94 write!(self.handle, "{}", " ".repeat(self.panel_width))?;
tests/snapshots/output/grid,header.snapshot.txt+1−1
@@ -1,5 +1,5 @@
1────────────────────────────────────────────────────────────────────────────────
1────────────────────────────────────────────────────────────────────────────────
2− File: sample.rs
2+File: sample.rs
3────────────────────────────────────────────────────────────────────────────────
3────────────────────────────────────────────────────────────────────────────────
4struct Rectangle {
4struct Rectangle {
5 width: u32,
5 width: u32,