From f0775f4a1a50247fda1adb53ae9ea92aaaf59546 Mon Sep 17 00:00:00 2001 From: kyren Date: Mon, 12 Mar 2018 16:14:52 -0400 Subject: Move several asserts to only be active with debug, bump alpha version number --- src/util.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/util.rs') diff --git a/src/util.rs b/src/util.rs index b5ba46a..99b623c 100644 --- a/src/util.rs +++ b/src/util.rs @@ -158,7 +158,7 @@ where // 3) Otherwise, interprets the error as the appropriate lua error. // Uses 2 stack spaces, does not call lua_checkstack. pub unsafe fn pop_error(state: *mut ffi::lua_State, err_code: c_int) -> Error { - rlua_assert!( + rlua_debug_assert!( err_code != ffi::LUA_OK && err_code != ffi::LUA_YIELD, "pop_error called with non-error return code" ); @@ -229,7 +229,7 @@ pub unsafe fn push_userdata(state: *mut ffi::lua_State, t: T) -> Result<()> { pub unsafe fn get_userdata(state: *mut ffi::lua_State, index: c_int) -> *mut T { let ud = ffi::lua_touserdata(state, index) as *mut T; - rlua_assert!(!ud.is_null(), "userdata pointer is null"); + rlua_debug_assert!(!ud.is_null(), "userdata pointer is null"); ud } @@ -243,7 +243,7 @@ pub unsafe fn take_userdata(state: *mut ffi::lua_State) -> T { get_destructed_userdata_metatable(state); ffi::lua_setmetatable(state, -2); let ud = ffi::lua_touserdata(state, -1) as *mut T; - rlua_assert!(!ud.is_null(), "userdata pointer is null"); + rlua_debug_assert!(!ud.is_null(), "userdata pointer is null"); ffi::lua_pop(state, 1); ptr::read(ud) } -- cgit v1.2.3