Avoid extra text allocations in websocket example
This commit is contained in:
parent
dee43d5f66
commit
488cac7148
2 changed files with 18 additions and 9 deletions
|
|
@ -2,7 +2,7 @@ mod echo;
|
|||
|
||||
use iced::alignment::{self, Alignment};
|
||||
use iced::widget::{
|
||||
button, column, container, row, scrollable, text, text_input, value,
|
||||
button, column, container, row, scrollable, text, text_input,
|
||||
};
|
||||
use iced::{color, Command, Element, Length, Subscription};
|
||||
use once_cell::sync::Lazy;
|
||||
|
|
@ -96,7 +96,7 @@ impl WebSocket {
|
|||
.into()
|
||||
} else {
|
||||
scrollable(
|
||||
column(self.messages.iter().map(value).map(Element::from))
|
||||
column(self.messages.iter().map(text).map(Element::from))
|
||||
.spacing(10),
|
||||
)
|
||||
.id(MESSAGE_LOG.clone())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue