From b8d5df28172a9f50c8b48123df05a336801f2bdc Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 1 Apr 2024 21:36:52 +0200 Subject: Reintroduce old `text` helper as `value` helper --- examples/websocket/src/main.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'examples/websocket/src') diff --git a/examples/websocket/src/main.rs b/examples/websocket/src/main.rs index ef450524..369ae820 100644 --- a/examples/websocket/src/main.rs +++ b/examples/websocket/src/main.rs @@ -2,7 +2,7 @@ mod echo; use iced::alignment::{self, Alignment}; use iced::widget::{ - button, column, container, row, scrollable, text, text_input, + button, column, container, row, scrollable, text, text_input, value, }; use iced::{color, Command, Element, Length, Subscription}; use once_cell::sync::Lazy; @@ -96,14 +96,8 @@ impl WebSocket { .into() } else { scrollable( - column( - self.messages - .iter() - .map(ToString::to_string) - .map(text) - .map(Element::from), - ) - .spacing(10), + column(self.messages.iter().map(value).map(Element::from)) + .spacing(10), ) .id(MESSAGE_LOG.clone()) .height(Length::Fill) -- cgit