summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2024-02-02 16:15:40 +0100
committerLibravatar GitHub <noreply@github.com>2024-02-02 16:15:40 +0100
commit1049fbbb1c08f2e1348429faa6a8e6050723978e (patch)
tree31e512bb610cbe2cdcd7fbffd362f576b4926ba3 /examples
parentaea172543cb49f1f1e3625f60b49336f59e26c00 (diff)
parentaa153d04e70101596dda0e4ee7228128cdfa39d6 (diff)
downloadiced-1049fbbb1c08f2e1348429faa6a8e6050723978e.tar.gz
iced-1049fbbb1c08f2e1348429faa6a8e6050723978e.tar.bz2
iced-1049fbbb1c08f2e1348429faa6a8e6050723978e.zip
Merge pull request #2223 from brianch/fix-sysinfo-example
Small fix to the Information struct docs and fix memory info. in the system_information example.
Diffstat (limited to 'examples')
-rw-r--r--examples/system_information/src/main.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/system_information/src/main.rs b/examples/system_information/src/main.rs
index 507431ee..31dc92f1 100644
--- a/examples/system_information/src/main.rs
+++ b/examples/system_information/src/main.rs
@@ -102,19 +102,19 @@ impl Application for Example {
));
let memory_readable =
- ByteSize::kb(information.memory_total).to_string();
+ ByteSize::b(information.memory_total).to_string();
let memory_total = text(format!(
- "Memory (total): {} kb ({memory_readable})",
+ "Memory (total): {} bytes ({memory_readable})",
information.memory_total,
));
let memory_text = if let Some(memory_used) =
information.memory_used
{
- let memory_readable = ByteSize::kb(memory_used).to_string();
+ let memory_readable = ByteSize::b(memory_used).to_string();
- format!("{memory_used} kb ({memory_readable})")
+ format!("{memory_used} bytes ({memory_readable})")
} else {
String::from("None")
};