refactor/polish ~ fix cargo clippy complaints (unneeded transmute)

This commit is contained in:
Roy Ivy III 2019-12-25 23:43:19 -06:00
parent f933c60a41
commit aa2ed76846

View file

@ -85,10 +85,9 @@ pub fn uumain(args: Vec<String>) -> i32 {
#[cfg(unix)]
fn print_loadavg() {
use libc::c_double;
use std::mem::transmute;
let mut avg: [c_double; 3] = [0.0; 3];
let loads: i32 = unsafe { transmute(getloadavg(avg.as_mut_ptr(), 3)) };
let loads: i32 = unsafe { getloadavg(avg.as_mut_ptr(), 3) };
if loads == -1 {
println!();