diff options
| -rw-r--r-- | Cargo.toml | 4 | ||||
| -rw-r--r-- | src/vm.rs | 6 |
2 files changed, 8 insertions, 2 deletions
@@ -9,3 +9,7 @@ edition = "2018" [dependencies] logos = "0.11.4" owo-colors = { git="https://github.com/FredTheDino/owo-colors.git" } + +[profile.release] +debug = true +lto = "thin" @@ -128,8 +128,10 @@ pub fn run_block(block: Block) -> Result<(), Error> { impl VM { fn pop_twice(&mut self) -> (Value, Value) { - let (a, b) = (self.stack.pop().unwrap(), self.stack.pop().unwrap()); - (b, a) + let len = self.stack.len(); + let res = (self.stack[len-2].clone(), self.stack[len-1].clone()); + self.stack.truncate(len - 2); + res } fn _peek_up(&self, amount: usize) -> Option<&Value> { |
