summaryrefslogtreecommitdiff
path: root/src/util.rs
diff options
context:
space:
mode:
authorAlex Orlenko <zxteam@protonmail.com>2019-11-04 22:23:09 +0000
committerAlex Orlenko <zxteam@protonmail.com>2019-11-04 22:23:09 +0000
commit29aa25a48b04534ec71f072e7c9fe183d7c8bdf9 (patch)
treec943fd907990ecfdb91fb9806d0978f4fef11c4b /src/util.rs
parent85607d8bfc6f8b7ef5ec776e51730a89165c45b6 (diff)
downloadmlua-29aa25a48b04534ec71f072e7c9fe183d7c8bdf9.zip
Dont take wrapped panic in error_tostring()
Diffstat (limited to 'src/util.rs')
-rw-r--r--src/util.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util.rs b/src/util.rs
index 513d35f..4e0b64f 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -526,7 +526,7 @@ pub unsafe fn init_error_registry(state: *mut ffi::lua_State) {
Ok(err_buf)
} else if is_wrapped_panic(state, -1) {
let panic = get_userdata::<WrappedPanic>(state, -1);
- if let Some(p) = (*panic).0.take() {
+ if let Some(ref p) = (*panic).0 {
ffi::lua_pushlightuserdata(
state,
&ERROR_PRINT_BUFFER_KEY as *const u8 as *mut c_void,
@@ -547,7 +547,7 @@ pub unsafe fn init_error_registry(state: *mut ffi::lua_State) {
let _ = write!(&mut (*err_buf), "{}", error);
Ok(err_buf)
} else {
- mlua_panic!("error during panic handling, panic was resumed twice")
+ mlua_panic!("error during panic handling, panic was resumed")
}
} else {
// I'm not sure whether this is possible to trigger without bugs in mlua?