Skip to content

Commit

Permalink
fix the get cpu desc problem
Browse files Browse the repository at this point in the history
  • Loading branch information
nishuzumi committed Mar 24, 2024
1 parent 75aa128 commit 8358dab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ pub fn get_cpu_desc() -> String {

#[cfg(target_os = "linux")]
pub fn get_cpu_desc() -> String {
use std::io::{BufRead, BufReader};
let file = std::fs::File::open("/proc/cpuinfo").expect("Could not open /proc/cpuinfo");
let reader = std::io::BufReader::new(file);

Expand All @@ -231,7 +232,7 @@ pub fn get_cpu_desc() -> String {
#[cfg(target_os = "windows")]
pub fn get_cpu_desc() -> String {
let output = Command::new("wmic")
.args(&["cpu", "get", "name"])
.args(["cpu", "get", "name"])
.output()
.expect("failed to execute process");

Expand Down

0 comments on commit 8358dab

Please sign in to comment.