From 72af1f2db0a49392db6eaffd7005191ac10ad664 Mon Sep 17 00:00:00 2001 From: Gerrit Viljoen Date: Sun, 17 May 2020 12:37:48 +0200 Subject: [PATCH] save game --- src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index b031ef8..988df66 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -269,12 +269,12 @@ impl AsciiTable { } fn format_first(&self, widths: &[usize]) -> String { - let row: Vec = widths.iter().map(|&x| SmartString::from(EW.repeat(x))).collect(); + let row: Vec<_> = widths.iter().map(|&x| SmartString::from_visible(EW.repeat(x))).collect(); self.format_line(&row, &format!("{}{}", SE, EW), &format!("{}{}{}", EW, EWS, EW), &format!("{}{}", EW, SW)) } fn format_middle(&self, widths: &[usize]) -> String { - let row: Vec = widths.iter().map(|&x| SmartString::from(EW.repeat(x))).collect(); + let row: Vec<_> = widths.iter().map(|&x| SmartString::from_visible(EW.repeat(x))).collect(); self.format_line(&row, &format!("{}{}", NES, EW), &format!("{}{}{}", EW, NEWS, EW), &format!("{}{}", EW, NWS)) } @@ -290,14 +290,14 @@ impl AsciiTable { } fn format_header_row(&self, row: &[SmartString], widths: &[usize]) -> String { - let row: Vec = row.iter().zip(widths.iter()).map(|(cell, &width)| + let row: Vec<_> = row.iter().zip(widths.iter()).map(|(cell, &width)| self.format_cell(cell, width, ' ', Align::Left) ).collect(); self.format_line(&row, &format!("{}{}", NS, ' '), &format!("{}{}{}", ' ', NS, ' '), &format!("{}{}", ' ', NS)) } fn format_last(&self, widths: &[usize]) -> String { - let row: Vec = widths.iter().map(|&x| SmartString::from(EW.repeat(x))).collect(); + let row: Vec<_> = widths.iter().map(|&x| SmartString::from_visible(EW.repeat(x))).collect(); self.format_line(&row, &format!("{}{}", NE, EW), &format!("{}{}{}", EW, NEW, EW), &format!("{}{}", EW, NW)) }