diff options
author | kyren <kerriganw@gmail.com> | 2018-03-12 16:14:52 -0400 |
---|---|---|
committer | kyren <kerriganw@gmail.com> | 2018-03-12 16:14:52 -0400 |
commit | f0775f4a1a50247fda1adb53ae9ea92aaaf59546 (patch) | |
tree | e166d9cdff18792240d2ec324485aa37afdf1a5d /src/util.rs | |
parent | f79d771f1a9e49cc5e7e7cf2553abb0d37339e36 (diff) | |
download | mlua-f0775f4a1a50247fda1adb53ae9ea92aaaf59546.zip |
Move several asserts to only be active with debug, bump alpha version number
Diffstat (limited to 'src/util.rs')
-rw-r--r-- | src/util.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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<T>(state: *mut ffi::lua_State, t: T) -> Result<()> { pub unsafe fn get_userdata<T>(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<T>(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) } |