Fix move errors with clone.
This commit is contained in:
parent
919b312d68
commit
9bc27b841b
@ -69,7 +69,7 @@ impl DmVirtualMachine {
|
||||
|
||||
// push args
|
||||
for i in 0..args.len() {
|
||||
self.registers.insert(i, args[i]);
|
||||
self.registers.insert(i, args[i].clone());
|
||||
}
|
||||
|
||||
// run the byte code
|
||||
|
@ -44,7 +44,7 @@ pub fn dm_print(args: Vec<DmValue>, vm: &mut DmVirtualMachine) -> DmValue {
|
||||
}
|
||||
DmPointer(ptr) => {
|
||||
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 {
|
||||
DmPointer(dm_string_ptr) => {
|
||||
let string = get_rust_string_from_dm_string(dm_string_ptr);
|
||||
|
Loading…
Reference in New Issue
Block a user