commit 0a6619f50505213e8b8d54bc74868237448981cd
parent aa3a7f0297a6dfb679f1c7a163267e810702a10e
Author: Sylvia Ivory <git@sivory.net>
Date: Mon, 23 Jun 2025 03:29:34 -0700
Cleanup inspect::display_table return type
Diffstat:
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/inspect.rs b/src/inspect.rs
@@ -347,17 +347,16 @@ fn display_table_inner(
Ok(buffer)
}
-pub fn display_table(tbl: &LuaTable, colorize: bool) -> Result<String, fmt::Error> {
+pub fn display_table(tbl: &LuaTable, colorize: bool) -> LuaResult<String> {
let mut seen = HashMap::new();
display_table_inner(tbl, colorize, &mut seen, 0)
+ .map_err(|e| LuaError::ExternalError(Arc::new(e)))
}
pub fn inspect(value: &LuaValue, colorize: bool) -> LuaResult<String> {
match value {
- LuaValue::Table(tbl) => {
- display_table(tbl, colorize).map_err(|e| LuaError::ExternalError(Arc::new(e)))
- }
+ LuaValue::Table(tbl) => display_table(tbl, colorize),
value => Ok(display_basic(value, colorize)),
}
}