Use usize to get pointer size

According to Rust documentation, usize is "The pointer-sized unsigned
integer type".

This change removes unnecessary libc dependency and makes top_evil_rs
script happier.
This commit is contained in:
Alexander Krotov
2019-12-22 01:07:44 +03:00
parent 8e0a29e9b5
commit 67c36f3d98

View File

@@ -79,12 +79,7 @@ pub fn get_info() -> HashMap<&'static str, String> {
"sqlite_thread_safe",
unsafe { rusqlite::ffi::sqlite3_threadsafe() }.to_string(),
);
res.insert(
"arch",
(std::mem::size_of::<*mut libc::c_void>())
.wrapping_mul(8)
.to_string(),
);
res.insert("arch", (std::mem::size_of::<usize>() * 8).to_string());
res.insert("level", "awesome".into());
res
}