summaryrefslogtreecommitdiffstats
path: root/examples/system_information
diff options
context:
space:
mode:
authorLibravatar brianch <brianch@users.noreply.github.com>2024-01-31 15:00:13 -0300
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-02-02 16:02:17 +0100
commit701bf22af65b0968bfe45fc732bb102f81df46d7 (patch)
tree01b509c6c74d878324ece843b239db64df4eec5f /examples/system_information
parentaea172543cb49f1f1e3625f60b49336f59e26c00 (diff)
downloadiced-701bf22af65b0968bfe45fc732bb102f81df46d7.tar.gz
iced-701bf22af65b0968bfe45fc732bb102f81df46d7.tar.bz2
iced-701bf22af65b0968bfe45fc732bb102f81df46d7.zip
The memory information is returned in bytes and not kb.
Fix the documentation of the Information struct, and the example system_information that uses it. Co-authored-by: =?UTF-8?q?Ahmet=20Kaan=20G=C3=9CM=C3=9C=C5=9E?= <96421894+Tahinli@users.noreply.github.com>
Diffstat (limited to 'examples/system_information')
-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")
};