From 49223eed06a0b0a980eeff123c31746906d0139d Mon Sep 17 00:00:00 2001 From: Connor Kuehl Date: Tue, 8 May 2018 12:51:52 -0700 Subject: [PATCH] Remove term_width from Printer, its options owns it. --- src/printer.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/printer.rs b/src/printer.rs index b5cefa66..0d0a84c5 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -10,7 +10,6 @@ const PANEL_WIDTH: usize = 7; pub struct Printer<'a> { handle: &'a mut Write, colors: Colors, - term_width: usize, options: &'a Options<'a>, pub line_changes: Option, } @@ -26,7 +25,6 @@ impl<'a> Printer<'a> { Printer { handle, colors, - term_width: options.term_width, options, line_changes: None, } @@ -137,7 +135,7 @@ impl<'a> Printer<'a> { } fn print_horizontal_line(&mut self, grid_char: char) -> Result<()> { - let hline = "─".repeat(self.term_width - (PANEL_WIDTH + 1)); + let hline = "─".repeat(self.options.term_width - (PANEL_WIDTH + 1)); let hline = format!("{}{}{}", "─".repeat(PANEL_WIDTH), grid_char, hline); writeln!(self.handle, "{}", self.colors.grid.paint(hline))?;