Optimisation.

This commit is contained in:
Gerrit Viljoen 2020-04-01 20:54:09 +02:00
parent 4b8c1f5c31
commit b57e0eb6c8

View File

@ -129,7 +129,7 @@ impl AsciiTable {
let num_cols = data.iter().map(|x| x.len()).max().unwrap();
let data = self.square_data(data, num_cols);
let has_header = self.columns.iter().any(|(_, x)| x.header.chars().count() > 0); // TODO: !is_empty
let has_header = self.columns.iter().any(|(_, col)| !col.header.is_empty());
let widths = self.column_widths(&data, num_cols);
let mut result = String::new();