mindustry logic execution, map- and schematic- parsing and rendering
Diffstat (limited to 'lemu/src/instructions/io.rs')
| -rw-r--r-- | lemu/src/instructions/io.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lemu/src/instructions/io.rs b/lemu/src/instructions/io.rs index b6564a8..75b9c0e 100644 --- a/lemu/src/instructions/io.rs +++ b/lemu/src/instructions/io.rs @@ -16,7 +16,7 @@ pub struct Read<'v> { impl<'v> LInstruction<'v> for Read<'v> { fn run<W: Wr>(&self, exec: &mut ExecutorContext<'v, W>) -> Flow { let to = exec.mem(self.container)[self.index]; - let Some(out) = exec.get_mut(self.output) else { + let Some(out) = exec.get_mut(&self.output) else { return Flow::Continue; }; *out = LVar::from(to); @@ -34,7 +34,7 @@ pub struct Write<'v> { impl<'v> LInstruction<'v> for Write<'v> { fn run<W: Wr>(&self, exec: &mut ExecutorContext<'v, W>) -> Flow { - let LVar::Num(n) = exec.get(self.set) else { + let &LVar::Num(n) = exec.get(&self.set) else { return Flow::Continue; }; exec.mem(self.container)[self.index] = n; @@ -48,7 +48,7 @@ pub struct Print<'v> { } impl LInstruction<'_> for Print<'_> { fn run<W: Wr>(&self, exec: &mut ExecutorContext<'_, W>) -> Flow { - let v = exec.get(self.val); + let v = exec.get(&self.val).clone(); if let Some(o) = &mut exec.output { write!(o, "{v}").unwrap(); } |