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() }