From 19ee453172fcf7e515b69534f79f08a0eac00202 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Tue, 23 Jan 2024 20:31:51 -0500 Subject: [PATCH] Fix Table::raw_len --- src/table.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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) }