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! |
Beta Was this translation helpful? Give feedback.
0 replies
-
Whoa! I've never seen that before. Thank you for the fair answer 👍 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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 =)Beta Was this translation helpful? Give feedback.
All reactions