Minor rearrangement

This commit is contained in:
Wojciech Kozlowski 2018-12-31 00:07:10 +08:00
parent 341ba8ceec
commit ad6720f11c

View File

@ -30,11 +30,7 @@ pub fn get_temp(hwmon: &PathBuf) -> Result<String> {
pub fn get_load_avgs() -> Result<String> { pub fn get_load_avgs() -> Result<String> {
let mut avgs: [libc::c_double; 3] = [0.0; 3]; let mut avgs: [libc::c_double; 3] = [0.0; 3];
let rc: libc::c_int; let rc = unsafe { libc::getloadavg(&mut avgs[0] as *mut libc::c_double, 3) };
unsafe {
rc = libc::getloadavg(&mut avgs[0] as *mut libc::c_double, 3);
}
if rc < 0 { if rc < 0 {
return Err(StatusError::System(rc)); return Err(StatusError::System(rc));
} }