From 3714da5ec8a1029aac077756c6531918e0b64915 Mon Sep 17 00:00:00 2001 From: Alex Orlenko Date: Mon, 23 Sep 2024 11:01:32 +0100 Subject: [PATCH] Fix doc test for `Lua::set_type_metatable` --- src/state.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/state.rs b/src/state.rs index f695296b..f5f76d53 100644 --- a/src/state.rs +++ b/src/state.rs @@ -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::(Some(mt)); /// lua.load("assert(tostring(true) == '2')").exec()?; /// # Ok(())