Use length instead of percentage for constraint

This commit is contained in:
Dheepak Krishnamurthy 2020-10-10 20:08:14 -06:00
parent 7209ae37c0
commit 738bce9a21

View file

@ -815,9 +815,7 @@ impl TTApp {
} }
let constraints: Vec<Constraint> = widths let constraints: Vec<Constraint> = widths
.iter() .iter()
.map(|i| { .map(|i| Constraint::Length((*i).try_into().unwrap_or(10)))
Constraint::Percentage(std::cmp::min(70, std::cmp::max(*i, 5)).try_into().unwrap())
})
.collect(); .collect();
let t = Table::new(header, rows.into_iter()) let t = Table::new(header, rows.into_iter())