Skip to content

Commit

Permalink
Clippy approved.
Browse files Browse the repository at this point in the history
  • Loading branch information
IntQuant committed Sep 28, 2024
1 parent 1184c8c commit 1f344d4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ewext/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct ExtState {

// const EWEXT: [(&'static str, Function); 1] = [("testfn", None)];

extern "C" fn init_particle_world_state(lua: *mut lua_State) -> c_int {
unsafe extern "C" fn init_particle_world_state(lua: *mut lua_State) -> c_int {
println!("\nInitializing particle world state");
let world_pointer = unsafe { LUA.lua_tointeger(lua, 1) };
let chunk_map_pointer = unsafe { LUA.lua_tointeger(lua, 2) };
Expand All @@ -45,7 +45,7 @@ extern "C" fn init_particle_world_state(lua: *mut lua_State) -> c_int {
0
}

extern "C" fn encode_area(lua: *mut lua_State) -> c_int {
unsafe extern "C" fn encode_area(lua: *mut lua_State) -> c_int {
let start_x = unsafe { LUA.lua_tointeger(lua, 1) } as i32;
let start_y = unsafe { LUA.lua_tointeger(lua, 2) } as i32;
let end_x = unsafe { LUA.lua_tointeger(lua, 3) } as i32;
Expand All @@ -61,8 +61,11 @@ extern "C" fn encode_area(lua: *mut lua_State) -> c_int {
1
}

/// # Safety
///
/// Only gets called by lua when loading a module.
#[no_mangle]
pub extern "C" fn luaopen_ewext(lua: *mut lua_State) -> c_int {
pub unsafe extern "C" fn luaopen_ewext(lua: *mut lua_State) -> c_int {
println!("Initializing ewext");
unsafe {
LUA.lua_createtable(lua, 0, 0);
Expand Down

0 comments on commit 1f344d4

Please sign in to comment.