More aggressively remove code from error_guard
This commit is contained in:
parent
d5ec09614c
commit
91dbbfe759
13
src/lua.rs
13
src/lua.rs
|
@ -229,9 +229,10 @@ impl<'lua> LuaTable<'lua> {
|
||||||
lua.push_value(lua.state, value);
|
lua.push_value(lua.state, value);
|
||||||
error_guard(lua.state, 3, |state| {
|
error_guard(lua.state, 3, |state| {
|
||||||
ffi::lua_settable(state, -3);
|
ffi::lua_settable(state, -3);
|
||||||
ffi::lua_pop(state, 1);
|
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})?;
|
||||||
|
ffi::lua_pop(lua.state, 1);
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,11 +316,11 @@ impl<'lua> LuaTable<'lua> {
|
||||||
unsafe {
|
unsafe {
|
||||||
check_stack(lua.state, 3);
|
check_stack(lua.state, 3);
|
||||||
lua.push_ref(lua.state, &self.0);
|
lua.push_ref(lua.state, &self.0);
|
||||||
error_guard(lua.state, 1, |state| {
|
let len = error_guard(lua.state, 1, |state| {
|
||||||
let len = ffi::luaL_len(state, -1);
|
Ok(ffi::luaL_len(state, -1))
|
||||||
ffi::lua_pop(state, 1);
|
})?;
|
||||||
|
ffi::lua_pop(lua.state, 1);
|
||||||
Ok(len)
|
Ok(len)
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue