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
757d932ac0
commit
44544db47e
@ -89,7 +89,7 @@ fn format_table_inner(data: Vec<Vec<String>>, conf: &TableConfig) -> String {
|
|||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
fn valid(data: &Vec<Vec<String>>, conf: &TableConfig) -> bool {
|
fn valid(data: &[Vec<String>], conf: &TableConfig) -> bool {
|
||||||
if data.len() == 0 {
|
if data.len() == 0 {
|
||||||
false
|
false
|
||||||
} else if conf.width < 4 {
|
} else if conf.width < 4 {
|
||||||
@ -149,7 +149,7 @@ fn truncate_widths(mut widths: Vec<u32>, conf: &TableConfig) -> Vec<u32> {
|
|||||||
widths
|
widths
|
||||||
}
|
}
|
||||||
|
|
||||||
fn format_line(row: &Vec<String>, head: &str, delim: &str, tail: &str) -> String {
|
fn format_line(row: &[String], head: &str, delim: &str, tail: &str) -> String {
|
||||||
let mut result = String::new();
|
let mut result = String::new();
|
||||||
result.push_str(head);
|
result.push_str(head);
|
||||||
for cell in row {
|
for cell in row {
|
||||||
|
Loading…
Reference in New Issue
Block a user