diff options
author | 2022-02-11 17:50:12 +0700 | |
---|---|---|
committer | 2022-02-11 17:50:12 +0700 | |
commit | 897188317b5875cc00a0f1c797790df8ac13687f (patch) | |
tree | 2a2eeedc8d582f616eaa0030000d15d403c1092b /examples/pure/counter/src | |
parent | e03de019881f31d69b70a64c3e278ae5200d5080 (diff) | |
download | iced-897188317b5875cc00a0f1c797790df8ac13687f.tar.gz iced-897188317b5875cc00a0f1c797790df8ac13687f.tar.bz2 iced-897188317b5875cc00a0f1c797790df8ac13687f.zip |
Rename `iced_virtual` to `iced_pure`
`virtual` is a reserved keyword in Rust :grimacing:
Diffstat (limited to '')
-rw-r--r-- | examples/pure/counter/src/main.rs (renamed from examples/virtual_counter/src/main.rs) | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/virtual_counter/src/main.rs b/examples/pure/counter/src/main.rs index 10d32112..e2746d40 100644 --- a/examples/virtual_counter/src/main.rs +++ b/examples/pure/counter/src/main.rs @@ -1,5 +1,5 @@ use iced::{Alignment, Element, Sandbox, Settings}; -use iced_virtual::{Button, Column, Text, Virtual}; +use iced_pure::{Button, Column, Pure, State, Text}; pub fn main() -> iced::Result { Counter::run(Settings::default()) @@ -7,7 +7,7 @@ pub fn main() -> iced::Result { struct Counter { value: i32, - state: iced_virtual::State<Message, iced::Renderer>, + state: State<Message, iced::Renderer>, } #[derive(Debug, Clone, Copy)] @@ -22,7 +22,7 @@ impl Sandbox for Counter { fn new() -> Self { Self { value: 0, - state: iced_virtual::State::new(), + state: State::new(), } } @@ -41,7 +41,7 @@ impl Sandbox for Counter { } } - fn view(&mut self) -> Element<Message> { + fn view(&mut self) -> Element<'_, Message> { let content = Column::new() .padding(20) .align_items(Alignment::Center) @@ -49,6 +49,6 @@ impl Sandbox for Counter { .push(Text::new(self.value.to_string()).size(50)) .push(Button::new("Decrement").on_press(Message::DecrementPressed)); - Virtual::new(&mut self.state, content).into() + Pure::new(&mut self.state, content).into() } } |