We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Lua::set_type_metatable
1 parent ca69be0 commit 3714da5Copy full SHA for 3714da5
src/state.rs
@@ -1350,7 +1350,7 @@ impl Lua {
1350
/// # fn main() -> Result<()> {
1351
/// # let lua = Lua::new();
1352
/// let mt = lua.create_table()?;
1353
- /// mt.set("__tostring", lua.create_function(|_, b: bool| Ok(if b { 2 } else { 0 }))?)?;
+ /// mt.set("__tostring", lua.create_function(|_, b: bool| Ok(if b { "2" } else { "0" }))?)?;
1354
/// lua.set_type_metatable::<bool>(Some(mt));
1355
/// lua.load("assert(tostring(true) == '2')").exec()?;
1356
/// # Ok(())
0 commit comments