diff --git a/src/luau/vm.rs b/src/luau/vm.rs index 85f4d9b..683a5b7 100644 --- a/src/luau/vm.rs +++ b/src/luau/vm.rs @@ -21,17 +21,17 @@ fn luau_error(err: mlua::Error) -> Option { } fn luau_out(luau_args: MultiValue) -> String { - let mut print: Vec = Vec::new(); + let mut print = String::new(); luau_args.iter() .map(|arg| arg.to_string().unwrap_or("".to_owned())) .for_each(|arg| { if !print.is_empty() { - print.push('\u{0009}'.to_string()); + print.push_str(&'\u{0009}'.to_string()); }; - print.push(arg); + print.push_str(&arg); } ); - print.concat() + print } trait Globals { @@ -42,7 +42,7 @@ trait Globals { impl Globals for Vm { fn print(&self) -> lResult<()> { self.0.globals().set("print", self.0.create_function(|_this, args: MultiValue| -> lResult<()> { - cprintln!("{}", luau_out(args)); + println!("{}", luau_out(args)); Ok(()) })?) }