Don't cast *const to *mut (for pointers comparison)

This commit is contained in:
Alex Orlenko 2022-04-08 22:51:33 +01:00
parent a8fef51e86
commit d1c80be033
No known key found for this signature in database
GPG Key ID: 4C150C250863B96D
2 changed files with 2 additions and 3 deletions

View File

@ -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) { 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); ffi::lua_rawgetp(state, ffi::LUA_REGISTRYINDEX, array_metatable_key);
} }

View File

@ -24,7 +24,6 @@ use {
std::{ std::{
cell::RefCell, cell::RefCell,
marker::PhantomData, marker::PhantomData,
os::raw::c_void,
pin::Pin, pin::Pin,
task::{Context, Poll, Waker}, task::{Context, Poll, Waker},
}, },
@ -436,7 +435,7 @@ where
fn is_poll_pending(val: &MultiValue) -> bool { fn is_poll_pending(val: &MultiValue) -> bool {
match val.iter().enumerate().last() { match val.iter().enumerate().last() {
Some((0, Value::LightUserData(ud))) => { 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, _ => false,
} }