From 8694eeb5c5ace4c2343e1eec3e64e27d36b656bd Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 15 Feb 2025 14:06:10 +0100 Subject: Use SI metrics for memory in `system_information` example --- examples/system_information/src/main.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/system_information/src/main.rs b/examples/system_information/src/main.rs index afa657d8..56f934b7 100644 --- a/examples/system_information/src/main.rs +++ b/examples/system_information/src/main.rs @@ -102,22 +102,22 @@ impl Example { ); let memory_readable = - ByteSize::b(information.memory_total).to_string(); + ByteSize::b(information.memory_total).to_string_as(true); let memory_total = text!( "Memory (total): {} bytes ({memory_readable})", information.memory_total, ); - let memory_text = if let Some(memory_used) = - information.memory_used - { - let memory_readable = ByteSize::b(memory_used).to_string(); + let memory_text = + if let Some(memory_used) = information.memory_used { + let memory_readable = + ByteSize::b(memory_used).to_string_as(true); - format!("{memory_used} bytes ({memory_readable})") - } else { - String::from("None") - }; + format!("{memory_used} bytes ({memory_readable})") + } else { + String::from("None") + }; let memory_used = text!("Memory (used): {memory_text}"); -- cgit