From 03a5b064e5b0b607c34ce05fb00cd81a3159708e Mon Sep 17 00:00:00 2001 From: rhpidfyre Date: Sat, 28 Dec 2024 15:39:06 -0500 Subject: [PATCH] genius --- src/luau/vm.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/luau/vm.rs b/src/luau/vm.rs index 584174e..ad4d1dc 100644 --- a/src/luau/vm.rs +++ b/src/luau/vm.rs @@ -14,16 +14,14 @@ fn new_instance() -> lResult { fn out(args: MultiValue) -> String { let mut print: Vec = Vec::new(); - let mut print_append = |v: String| { - if !print.is_empty() { - print.push(" ".to_owned()); + args.iter() + .map(|arg| arg.to_string().unwrap_or("".to_owned())) + .for_each(|v| { + if !print.is_empty() { + print.push(" ".to_owned()); + } + print.push(v); } - print.push(v) - }; - args.iter().for_each(|arg| - arg.to_string().map_or(print_append("".to_owned()), - |s_arg| print_append(s_arg) - ) ); print.concat() }