summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/system_information/Cargo.toml2
-rw-r--r--examples/system_information/src/main.rs18
2 files changed, 7 insertions, 13 deletions
diff --git a/examples/system_information/Cargo.toml b/examples/system_information/Cargo.toml
index d3d76182..13a59d5e 100644
--- a/examples/system_information/Cargo.toml
+++ b/examples/system_information/Cargo.toml
@@ -6,5 +6,5 @@ edition = "2021"
publish = false
[dependencies]
-iced = { path = "../..", features = ["sysinfo"] }
+iced = { path = "../.." }
bytesize = { version = "1.1.0" } \ No newline at end of file
diff --git a/examples/system_information/src/main.rs b/examples/system_information/src/main.rs
index 1e61480f..704f5f4d 100644
--- a/examples/system_information/src/main.rs
+++ b/examples/system_information/src/main.rs
@@ -15,12 +15,11 @@ enum Example {
information: system::Information,
refresh_button: button::State,
},
- Unsupported,
}
#[derive(Clone, Debug)]
enum Message {
- InformationReceived(Option<system::Information>),
+ InformationReceived(system::Information),
Refresh,
}
@@ -46,15 +45,11 @@ impl Application for Example {
return system::fetch_information(Message::InformationReceived);
}
Message::InformationReceived(information) => {
- if let Some(information) = information {
- let refresh_button = button::State::new();
- *self = Self::Loaded {
- information,
- refresh_button,
- };
- } else {
- *self = Self::Unsupported;
- }
+ let refresh_button = button::State::new();
+ *self = Self::Loaded {
+ information,
+ refresh_button,
+ };
}
}
@@ -156,7 +151,6 @@ impl Application for Example {
.spacing(10)
.into()
}
- Example::Unsupported => Text::new("Unsupported!").size(20).into(),
};
Container::new(content)