mirror of
https://gitlab.com/arnekeller/ascii-table.git
synced 2024-12-04 21:49:08 +00:00
Refactoring.
This commit is contained in:
parent
f868e41acb
commit
f90537b8ca
@ -201,7 +201,9 @@ fn format_last(widths: &[usize]) -> String {
|
||||
fn make_cell(text: &str, len: usize, pad: char, align: Align) -> String {
|
||||
if text.chars().count() > len {
|
||||
let mut result: String = text.chars().take(len).collect();
|
||||
if let Some(_) = result.pop() {result.push('+')};
|
||||
if result.pop().is_some() {
|
||||
result.push('+')
|
||||
}
|
||||
result
|
||||
} else {
|
||||
let mut result = text.to_string();
|
||||
|
Loading…
Reference in New Issue
Block a user