Replies: 1 comment 8 replies
-
let func = lua.create_function(|_lua, arg: Option<f32>| {
dbg!(arg);
Ok(arg)
})?;
You could try |
Beta Was this translation helpful? Give feedback.
8 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.
-
Hello, thanks for the great project.
I'm porting a large C+Lua code base to rust, and I'm wondering if there are any macros or tricks to deal with things like
luaL_optnumber
to help simplify making the bindings. Using match + throwing an error seems to be a lot more work. In particular, something that would be aluaL_optnumber
becomes something like:which is a bit more than the one-liner it is in C...
Also, C and rust are going to have to co-exist for a while. Is there any way to deal with Lua stack indices with mlua or do I have to resort to using the C API?
Beta Was this translation helpful? Give feedback.
All reactions