Skip to content

Commit 3714da5

Browse files
committed
Fix doc test for Lua::set_type_metatable
1 parent ca69be0 commit 3714da5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,7 @@ impl Lua {
13501350
/// # fn main() -> Result<()> {
13511351
/// # let lua = Lua::new();
13521352
/// let mt = lua.create_table()?;
1353-
/// mt.set("__tostring", lua.create_function(|_, b: bool| Ok(if b { 2 } else { 0 }))?)?;
1353+
/// mt.set("__tostring", lua.create_function(|_, b: bool| Ok(if b { "2" } else { "0" }))?)?;
13541354
/// lua.set_type_metatable::<bool>(Some(mt));
13551355
/// lua.load("assert(tostring(true) == '2')").exec()?;
13561356
/// # Ok(())

0 commit comments

Comments
 (0)