1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-22 22:42:48 +03:00

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
This commit is contained in:
Wez Furlong 2023-07-11 10:27:30 -07:00
parent c7ff432581
commit 523660c192
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387

View File

@ -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"),