mirror of
https://github.com/Wojtek242/rwmstatus.git
synced 2024-11-24 16:35:26 +01:00
Minor rearrangement
This commit is contained in:
parent
341ba8ceec
commit
ad6720f11c
@ -30,11 +30,7 @@ pub fn get_temp(hwmon: &PathBuf) -> Result<String> {
|
||||
pub fn get_load_avgs() -> Result<String> {
|
||||
let mut avgs: [libc::c_double; 3] = [0.0; 3];
|
||||
|
||||
let rc: libc::c_int;
|
||||
unsafe {
|
||||
rc = libc::getloadavg(&mut avgs[0] as *mut libc::c_double, 3);
|
||||
}
|
||||
|
||||
let rc = unsafe { libc::getloadavg(&mut avgs[0] as *mut libc::c_double, 3) };
|
||||
if rc < 0 {
|
||||
return Err(StatusError::System(rc));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user