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:
parent
d3229370f3
commit
0a91f2077d
3 changed files with 3 additions and 3 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue