Skip to content

Commit b4a1d85

Browse files
committed
refactor: omit the use of vectors in pprint
1 parent a47ccad commit b4a1d85

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/components/global.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,15 @@ pub fn pprint(lua: &mlua::Lua) -> mlua::Result<()> {
3131
lua.globals().set(
3232
"astra_internal__pretty_print",
3333
lua.create_function(|_, args: mlua::MultiValue| {
34-
let mut parts = Vec::new();
35-
3634
for input in args {
37-
let part = if let Some(s) = input.as_string() {
38-
s.to_string_lossy().to_string()
35+
if let Some(s) = input.as_string() {
36+
print!("{} ", s.to_string_lossy());
3937
} else if input.is_userdata() {
40-
format!("{input:?}")
38+
print!("{input:?} ")
4139
} else {
42-
format!("{input:#?}")
40+
print!("{input:#?} ")
4341
};
44-
parts.push(part);
4542
}
46-
println!("{}", parts.join("\t"));
4743

4844
Ok(())
4945
})?,

0 commit comments

Comments
 (0)