From 523660c19222d157969cf073709436050747478b Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Tue, 11 Jul 2023 10:27:30 -0700 Subject: [PATCH] lua: suppress userdata is not expected type error in repl When printing built-in-to-lua userdata, avoid tripping over an error message from mlua. refs: https://github.com/khvzak/mlua/issues/291 refs: https://github.com/wez/wezterm/issues/3849 --- luahelper/src/lib.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/luahelper/src/lib.rs b/luahelper/src/lib.rs index 4d352940f..1f47b1a07 100644 --- a/luahelper/src/lib.rs +++ b/luahelper/src/lib.rs @@ -411,9 +411,7 @@ impl<'lua> std::fmt::Debug for ValuePrinterHelper<'lua> { } } } - Err(err) => { - write!(fmt, "Error getting metatable: {err:#}") - } + Err(_) => fmt.write_str("userdata"), }, LuaValue::LightUserData(_) => fmt.write_str("userdata"), LuaValue::Thread(_) => fmt.write_str("thread"),