This repository was archived by the owner on Sep 12, 2025. It is now read-only.
Replies: 2 comments
|
Hi, What you need to do is require that pub fn set_global<T>(lua: &Lua, key: &str, value: T) -> LuaResult<()>
where T: for<'a> ToLua<'a>
{
// same body as before
}The above compiles for me. Hope this helps! |
0 replies
|
Whoa! I've never seen that before. Thank you for the fair answer 👍 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Consider the following helper function:
This results in the following:
How would one create such a helper? I can work around it by making the function use a
&Context<'lua>instead of&Lua, but for my particular setting, having to do lua.context(...) every time feels boilerplatey =)All reactions