Update toss

The latest toss commit includes a width function that runs directly on a
&Styled. This avoids using &styled.text(), which unnecessarily allocates
a new string. Probably premature optimization, but nicer to use
nontheless.
This commit is contained in:
Joscha 2022-07-12 10:26:38 +02:00
parent d3229370f3
commit 0a91f2077d
3 changed files with 3 additions and 3 deletions

View file

@ -40,7 +40,7 @@ impl Widget for Text {
let lines = self.wrapped(frame, max_width);
let min_width = lines
.iter()
.map(|l| frame.width(&l.text()))
.map(|l| frame.width_styled(l))
.max()
.unwrap_or(0);
let min_height = lines.len();