From d1c80be03356c48258533312db319701c5503eda Mon Sep 17 00:00:00 2001 From: Alex Orlenko Date: Fri, 8 Apr 2022 22:51:33 +0100 Subject: [PATCH] Don't cast *const to *mut (for pointers comparison) --- src/serde/mod.rs | 2 +- src/thread.rs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/serde/mod.rs b/src/serde/mod.rs index c31e7b1..bc2bb69 100644 --- a/src/serde/mod.rs +++ b/src/serde/mod.rs @@ -257,7 +257,7 @@ pub(crate) unsafe fn init_metatables(state: *mut ffi::lua_State) -> Result<()> { } pub(crate) unsafe fn push_array_metatable(state: *mut ffi::lua_State) { - let array_metatable_key = &ARRAY_METATABLE_REGISTRY_KEY as *const u8 as *mut c_void; + let array_metatable_key = &ARRAY_METATABLE_REGISTRY_KEY as *const u8 as *const c_void; ffi::lua_rawgetp(state, ffi::LUA_REGISTRYINDEX, array_metatable_key); } diff --git a/src/thread.rs b/src/thread.rs index 88658aa..9aafd0a 100644 --- a/src/thread.rs +++ b/src/thread.rs @@ -24,7 +24,6 @@ use { std::{ cell::RefCell, marker::PhantomData, - os::raw::c_void, pin::Pin, task::{Context, Poll, Waker}, }, @@ -436,7 +435,7 @@ where fn is_poll_pending(val: &MultiValue) -> bool { match val.iter().enumerate().last() { Some((0, Value::LightUserData(ud))) => { - ud.0 == &ASYNC_POLL_PENDING as *const u8 as *mut c_void + ud.0 as *const u8 == &ASYNC_POLL_PENDING as *const u8 } _ => false, }