summaryrefslogtreecommitdiffstats
path: root/src/sandbox.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-07-27 06:49:20 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-07-27 06:49:20 +0200
commitff2519b1d43d481987351a83b6dd7237524c21f0 (patch)
tree5731eeb7eb1247d4a8951de0d5bc5d8102640559 /src/sandbox.rs
parentc44267b85f7aaa2997e3caf1323b837d95818c22 (diff)
downloadiced-ff2519b1d43d481987351a83b6dd7237524c21f0.tar.gz
iced-ff2519b1d43d481987351a83b6dd7237524c21f0.tar.bz2
iced-ff2519b1d43d481987351a83b6dd7237524c21f0.zip
Replace stateful widgets with new `iced_pure` API
Diffstat (limited to 'src/sandbox.rs')
-rw-r--r--src/sandbox.rs10
1 files changed, 5 insertions, 5 deletions
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<Self::Message> {
-/// Text::new("Hello, world!").into()
+/// fn view(&self) -> Element<Self::Message> {
+/// "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)
}