diff options
author | Alex Orlenko <zxteam@protonmail.com> | 2022-10-23 03:13:24 +0100 |
---|---|---|
committer | Alex Orlenko <zxteam@protonmail.com> | 2022-10-23 03:13:24 +0100 |
commit | cca177df5bc5180fc039c2d1d4f58bfec5d113bd (patch) | |
tree | 267726f14b88498f4c537e8032284c6691cc5945 /src/serde/mod.rs | |
parent | 65396a910ff955ee011a979e266e5835cc566701 (diff) | |
download | mlua-cca177df5bc5180fc039c2d1d4f58bfec5d113bd.zip |
Minor serde optimizations
Diffstat (limited to 'src/serde/mod.rs')
-rw-r--r-- | src/serde/mod.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/serde/mod.rs b/src/serde/mod.rs index 74f0681..d0040f1 100644 --- a/src/serde/mod.rs +++ b/src/serde/mod.rs @@ -10,7 +10,7 @@ use crate::ffi; use crate::lua::Lua; use crate::table::Table; use crate::types::LightUserData; -use crate::util::{assert_stack, check_stack, StackGuard}; +use crate::util::check_stack; use crate::value::Value; /// Trait for serializing/deserializing Lua values using Serde. @@ -205,12 +205,8 @@ impl<'lua> LuaSerdeExt<'lua> for Lua { fn array_metatable(&'lua self) -> Table<'lua> { unsafe { - let _sg = StackGuard::new(self.state); - assert_stack(self.state, 1); - - push_array_metatable(self.state); - - Table(self.pop_ref()) + push_array_metatable(self.ref_thread()); + Table(self.pop_ref_thread()) } } |