Skip to content

Commit

Permalink
Fix doc test for Lua::set_type_metatable
Browse files Browse the repository at this point in the history
  • Loading branch information
khvzak committed Sep 23, 2024
1 parent ca69be0 commit 3714da5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,7 @@ impl Lua {
/// # fn main() -> Result<()> {
/// # let lua = Lua::new();
/// let mt = lua.create_table()?;
/// 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" }))?)?;
/// lua.set_type_metatable::<bool>(Some(mt));
/// lua.load("assert(tostring(true) == '2')").exec()?;
/// # Ok(())
Expand Down

0 comments on commit 3714da5

Please sign in to comment.