diff --git a/src/table.rs b/src/table.rs index eb8fb2d..e116d71 100644 --- a/src/table.rs +++ b/src/table.rs @@ -147,10 +147,8 @@ impl<'a> Table<'a> { let s = self.state.state_ptr(); unsafe { self.lref.push_to_lua_stack(self.state)?; - lua::lua_rawlen(s, -1); - - let len = lua::lua_tonumber(s, -1); - lua::lua_pop(self.state.state_ptr(), -1); + let len = lua::lua_rawlen(s, -1); + lua::lua_pop(s, -1); // pop table Ok(len as u64) }