From ff2519b1d43d481987351a83b6dd7237524c21f0 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 27 Jul 2022 06:49:20 +0200 Subject: Replace stateful widgets with new `iced_pure` API --- src/sandbox.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/sandbox.rs') diff --git a/src/sandbox.rs b/src/sandbox.rs index 3ca3fe8f..bdb6ad5a 100644 --- a/src/sandbox.rs +++ b/src/sandbox.rs @@ -56,7 +56,7 @@ use crate::{Application, Command, Element, Error, Settings, Subscription}; /// says "Hello, world!": /// /// ```no_run -/// use iced::{Element, Sandbox, Settings, Text}; +/// use iced::{Element, Sandbox, Settings}; /// /// pub fn main() -> iced::Result { /// Hello::run(Settings::default()) @@ -79,8 +79,8 @@ use crate::{Application, Command, Element, Error, Settings, Subscription}; /// // This application has no interactions /// } /// -/// fn view(&mut self) -> Element { -/// Text::new("Hello, world!").into() +/// fn view(&self) -> Element { +/// "Hello, world!".into() /// } /// } /// ``` @@ -108,7 +108,7 @@ pub trait Sandbox { /// Returns the widgets to display in the [`Sandbox`]. /// /// These widgets can produce __messages__ based on user interaction. - fn view(&mut self) -> Element<'_, Self::Message>; + fn view(&self) -> Element<'_, Self::Message>; /// Returns the current [`Theme`] of the [`Sandbox`]. /// @@ -184,7 +184,7 @@ where Command::none() } - fn view(&mut self) -> Element<'_, T::Message> { + fn view(&self) -> Element<'_, T::Message> { T::view(self) } -- cgit