Fix move errors with clone.

This commit is contained in:
Jesse Brault 2024-12-01 08:50:37 -06:00
parent 919b312d68
commit 9bc27b841b
2 changed files with 2 additions and 2 deletions

View File

@ -69,7 +69,7 @@ impl DmVirtualMachine {
// push args // push args
for i in 0..args.len() { for i in 0..args.len() {
self.registers.insert(i, args[i]); self.registers.insert(i, args[i].clone());
} }
// run the byte code // run the byte code

View File

@ -44,7 +44,7 @@ pub fn dm_print(args: Vec<DmValue>, vm: &mut DmVirtualMachine) -> DmValue {
} }
DmPointer(ptr) => { DmPointer(ptr) => {
if let Some(to_string) = get_method(*ptr, String::from("to_string")) { if let Some(to_string) = get_method(*ptr, String::from("to_string")) {
let call_result = vm.call(&to_string, vec![args[0]]); let call_result = vm.call(&to_string, vec![args[0].clone()]);
match call_result { match call_result {
DmPointer(dm_string_ptr) => { DmPointer(dm_string_ptr) => {
let string = get_rust_string_from_dm_string(dm_string_ptr); let string = get_rust_string_from_dm_string(dm_string_ptr);