diff options
author | 2022-02-11 17:50:12 +0700 | |
---|---|---|
committer | 2022-02-11 17:50:12 +0700 | |
commit | 897188317b5875cc00a0f1c797790df8ac13687f (patch) | |
tree | 2a2eeedc8d582f616eaa0030000d15d403c1092b /examples | |
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 'examples')
-rw-r--r-- | examples/pure/counter/Cargo.toml (renamed from examples/virtual_counter/Cargo.toml) | 6 | ||||
-rw-r--r-- | examples/pure/counter/README.md (renamed from examples/virtual_counter/README.md) | 0 | ||||
-rw-r--r-- | examples/pure/counter/index.html (renamed from examples/virtual_counter/index.html) | 0 | ||||
-rw-r--r-- | examples/pure/counter/src/main.rs (renamed from examples/virtual_counter/src/main.rs) | 10 |
4 files changed, 8 insertions, 8 deletions
diff --git a/examples/virtual_counter/Cargo.toml b/examples/pure/counter/Cargo.toml index 537d4174..1363bfd5 100644 --- a/examples/virtual_counter/Cargo.toml +++ b/examples/pure/counter/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "virtual_counter" +name = "pure_counter" version = "0.1.0" authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"] edition = "2021" publish = false [dependencies] -iced = { path = "../.." } -iced_virtual = { path = "../../virtual" } +iced = { path = "../../.." } +iced_pure = { path = "../../../pure" } diff --git a/examples/virtual_counter/README.md b/examples/pure/counter/README.md index 4d9fc5b9..4d9fc5b9 100644 --- a/examples/virtual_counter/README.md +++ b/examples/pure/counter/README.md diff --git a/examples/virtual_counter/index.html b/examples/pure/counter/index.html index d2e368e4..d2e368e4 100644 --- a/examples/virtual_counter/index.html +++ b/examples/pure/counter/index.html 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() } } |