Skip to content

Commit fc058eb

Browse files
committed
comment fixes
1 parent c22aae4 commit fc058eb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/util.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ pub unsafe extern "C" fn safe_xpcall(state: *mut ffi::lua_State) -> c_int {
398398
}
399399
}
400400

401-
// Does not call checkstack, uses 1 stack space
401+
// Does not call lua_checkstack, uses 1 stack space.
402402
pub unsafe fn main_state(state: *mut ffi::lua_State) -> *mut ffi::lua_State {
403403
ffi::lua_rawgeti(state, ffi::LUA_REGISTRYINDEX, ffi::LUA_RIDX_MAINTHREAD);
404404
let main_state = ffi::lua_tothread(state, -1);
@@ -420,12 +420,13 @@ pub unsafe fn push_wrapped_error(state: *mut ffi::lua_State, err: Error) {
420420

421421
// Pops a WrappedError off of the top of the stack, if it is a WrappedError. If it is not a
422422
// WrappedError, returns None and does not pop anything. Uses 2 stack spaces and does not call
423-
// lua_checkstack
423+
// lua_checkstack.
424424
pub unsafe fn pop_wrapped_error(state: *mut ffi::lua_State) -> Option<Error> {
425425
if !is_wrapped_error(state, -1) {
426426
None
427427
} else {
428428
let err = &*get_userdata::<WrappedError>(state, -1);
429+
// We are assuming here that Error::clone() cannot panic.
429430
let err = err.0.clone();
430431
ffi::lua_pop(state, 1);
431432
Some(err)

0 commit comments

Comments
 (0)