From 67c36f3d98436751539ab8429c2d694273d447c5 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Sun, 22 Dec 2019 01:07:44 +0300 Subject: [PATCH] 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. --- src/context.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/context.rs b/src/context.rs index 3d91c2f1e..cfa9a92e2 100644 --- a/src/context.rs +++ b/src/context.rs @@ -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::() * 8).to_string()); res.insert("level", "awesome".into()); res }