You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, I was testing some Discord API stuff in my project, which involves receiving and sending 64-bit values back and forth. I was under the assumption that Lua handled up to 64-bit numbers, but I ran into a bug when passing the application ID to Discord, from Lua, in Rust: the value received from Lua is off by quite a bit. You can test this yourself with this code:
fntest(_:&Lua,value:u64) -> mlua::Result<u64>{println!("rust_max: {}",u64::max_value());println!("rust: {value}");if value == 0{Ok(u64::max_value())}else{Ok(value)}}
Hey, I was testing some Discord API stuff in my project, which involves receiving and sending 64-bit values back and forth. I was under the assumption that Lua handled up to 64-bit numbers, but I ran into a bug when passing the application ID to Discord, from Lua, in Rust: the value received from Lua is off by quite a bit. You can test this yourself with this code:
Output:
In addition, mlua will crash when passing the
test
value in Lua back to Rust, with the errorerror converting Lua number to u64 (out of range)
.The text was updated successfully, but these errors were encountered: