From 46ec62abd175dc0675c61ce02f8febd9dde52a06 Mon Sep 17 00:00:00 2001 From: wizard <112275929+famouswizard@users.noreply.github.com> Date: Mon, 16 Dec 2024 20:09:27 +0300 Subject: [PATCH] fix: Fix incorrect method calls in sysinfo usage --- src/main.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index da0218fd7..08b7c7910 100644 --- a/src/main.rs +++ b/src/main.rs @@ -148,20 +148,19 @@ fn display_greeting() { fn display_sysinfo() { let mut sys = System::new_all(); - sys.refresh_all(); println!( "OS: {}", - System::name().unwrap_or("UNKNOWN".to_string()) + sys.name().unwrap_or_else(|| "UNKNOWN".to_string()) ); println!( "version: {}", - System::os_version().unwrap_or("UNKNOWN".to_string()) + sys.os_version().unwrap_or_else(|| "UNKNOWN".to_string()) ); println!( "Host: {}", - System::host_name().unwrap_or("UNKNOWN".to_string()) + sys.host_name().unwrap_or_else(|| "UNKNOWN".to_string()) ); println!("CPUs: {}", sys.cpus().len()); println!(