Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix incorrect method calls in sysinfo usage #528

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,20 +148,19 @@

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())

Check failure on line 155 in src/main.rs

View workflow job for this annotation

GitHub Actions / clippy

no method named `name` found for struct `sysinfo::System` in the current scope

Check failure on line 155 in src/main.rs

View workflow job for this annotation

GitHub Actions / test

no method named `name` found for struct `sysinfo::System` in the current scope
);
println!(
"version: {}",
System::os_version().unwrap_or("UNKNOWN".to_string())
sys.os_version().unwrap_or_else(|| "UNKNOWN".to_string())

Check failure on line 159 in src/main.rs

View workflow job for this annotation

GitHub Actions / clippy

no method named `os_version` found for struct `sysinfo::System` in the current scope

Check failure on line 159 in src/main.rs

View workflow job for this annotation

GitHub Actions / test

no method named `os_version` found for struct `sysinfo::System` in the current scope
);
println!(
"Host: {}",
System::host_name().unwrap_or("UNKNOWN".to_string())
sys.host_name().unwrap_or_else(|| "UNKNOWN".to_string())

Check failure on line 163 in src/main.rs

View workflow job for this annotation

GitHub Actions / clippy

no method named `host_name` found for struct `sysinfo::System` in the current scope

Check failure on line 163 in src/main.rs

View workflow job for this annotation

GitHub Actions / test

no method named `host_name` found for struct `sysinfo::System` in the current scope
);
println!("CPUs: {}", sys.cpus().len());
println!(
Expand Down
Loading