diff options
author | Alex Orlenko <zxteam@protonmail.com> | 2022-12-21 21:05:23 +0000 |
---|---|---|
committer | Alex Orlenko <zxteam@protonmail.com> | 2022-12-21 21:05:23 +0000 |
commit | 9d28b790e73cfb5184b30ac86a7e8153b2ed4e7f (patch) | |
tree | 8f3e813804aa43079b74f87a0fdf091bdd8a504e /tests/module/src | |
parent | 61c285746c82de927c1aeed1f465b828000a776f (diff) | |
download | mlua-9d28b790e73cfb5184b30ac86a7e8153b2ed4e7f.zip |
Fix module tests
Diffstat (limited to 'tests/module/src')
-rw-r--r-- | tests/module/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/module/src/lib.rs b/tests/module/src/lib.rs index 4e5aae5..329e15e 100644 --- a/tests/module/src/lib.rs +++ b/tests/module/src/lib.rs @@ -8,8 +8,8 @@ fn used_memory(lua: &Lua, _: ()) -> LuaResult<usize> { Ok(lua.used_memory()) } -fn check_userdata(_: &Lua, ud: MyUserData) -> LuaResult<i32> { - Ok(ud.0) +fn check_userdata(_: &Lua, ud: LuaAnyUserData) -> LuaResult<i32> { + Ok(ud.borrow::<MyUserData>()?.0) } #[mlua::lua_module] @@ -29,7 +29,7 @@ impl LuaUserData for MyUserData {} #[mlua::lua_module(name = "rust_module_second")] fn rust_module2(lua: &Lua) -> LuaResult<LuaTable> { let exports = lua.create_table()?; - exports.set("userdata", lua.create_userdata(MyUserData(123))?)?; + exports.set("userdata", MyUserData(123))?; Ok(exports) } |