mirror of
https://gitlab.com/arnekeller/ascii-table.git
synced 2024-12-04 21:49:08 +00:00
save game
This commit is contained in:
parent
239da146c0
commit
72af1f2db0
@ -269,12 +269,12 @@ impl AsciiTable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn format_first(&self, widths: &[usize]) -> String {
|
fn format_first(&self, widths: &[usize]) -> String {
|
||||||
let row: Vec<SmartString> = 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))
|
self.format_line(&row, &format!("{}{}", SE, EW), &format!("{}{}{}", EW, EWS, EW), &format!("{}{}", EW, SW))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn format_middle(&self, widths: &[usize]) -> String {
|
fn format_middle(&self, widths: &[usize]) -> String {
|
||||||
let row: Vec<SmartString> = 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))
|
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 {
|
fn format_header_row(&self, row: &[SmartString], widths: &[usize]) -> String {
|
||||||
let row: Vec<SmartString> = 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)
|
self.format_cell(cell, width, ' ', Align::Left)
|
||||||
).collect();
|
).collect();
|
||||||
self.format_line(&row, &format!("{}{}", NS, ' '), &format!("{}{}{}", ' ', NS, ' '), &format!("{}{}", ' ', NS))
|
self.format_line(&row, &format!("{}{}", NS, ' '), &format!("{}{}{}", ' ', NS, ' '), &format!("{}{}", ' ', NS))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn format_last(&self, widths: &[usize]) -> String {
|
fn format_last(&self, widths: &[usize]) -> String {
|
||||||
let row: Vec<SmartString> = 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))
|
self.format_line(&row, &format!("{}{}", NE, EW), &format!("{}{}{}", EW, NEW, EW), &format!("{}{}", EW, NW))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user