Skip to content

Commit

Permalink
Update using cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Camerooooon committed Feb 23, 2024
1 parent c9ac547 commit 8435ce2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 21 deletions.
13 changes: 5 additions & 8 deletions src/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -642,17 +642,14 @@ pub fn daemon_init(settings: Settings, config: Config) -> Arc<Mutex<Daemon>> {
// Make a cpu struct for each cpu listed
match list_cpus() {
Ok(cpus) => {

for cpu in cpus {
daemon.cpus.push(cpu);
}

},
Err(e) => {

daemon.logger.log(&format!("Failed to read from CPUs: {:?}", e), logger::Severity::Error)

},
}
Err(e) => daemon.logger.log(
&format!("Failed to read from CPUs: {:?}", e),
logger::Severity::Error,
),
}

let daemon_mutex = Arc::new(Mutex::new(daemon));
Expand Down
35 changes: 22 additions & 13 deletions src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ impl Getter for Get {
Ok(cpus) => {
let f = check_cpu_freq(&cpus);
print_freq(f, raw);
},
}
Err(e) => {
eprint!("Failed to get cpu information, an error occured: {:?}", e);
},
}
}
}

Expand Down Expand Up @@ -244,10 +244,10 @@ impl Getter for Get {
Ok(name) => print_cpus(cpus, name, raw),
Err(_) => println!("Failed get list of cpus"),
};
},
}
Err(e) => {
eprintln!("Failed to get cpu information, an error occured: {:?}", e);
},
}
}
}

Expand All @@ -256,10 +256,13 @@ impl Getter for Get {
match speeds_result {
Ok(speeds) => {
print_cpu_speeds(speeds, raw);
},
}
Err(e) => {
eprintln!("Failed to get cpu speed information, an error occured: {:?}", e);
},
eprintln!(
"Failed to get cpu speed information, an error occured: {:?}",
e
);
}
}
}

Expand All @@ -268,10 +271,13 @@ impl Getter for Get {
match cpu_temp_result {
Ok(cpu_temp) => {
print_cpu_temp(cpu_temp, raw);
},
}
Err(e) => {
eprintln!("Failed to get cpu temperature information, an error occured: {:?}", e);
},
eprintln!(
"Failed to get cpu temperature information, an error occured: {:?}",
e
);
}
}
}

Expand All @@ -280,10 +286,13 @@ impl Getter for Get {
match govs_result {
Ok(govs) => {
print_cpu_governors(govs, raw);
},
}
Err(e) => {
eprintln!("Failed to get cpu governor information, an error occured: {:?}", e);
},
eprintln!(
"Failed to get cpu governor information, an error occured: {:?}",
e
);
}
}
}

Expand Down

0 comments on commit 8435ce2

Please sign in to comment.