Merge pull request #87 from OddBloke/import

Un-mut some Frame/VirtualMachine methods
This commit is contained in:
Windel Bouwman
2018-08-26 19:38:23 +02:00
committed by GitHub
2 changed files with 6 additions and 6 deletions

View File

@@ -75,7 +75,7 @@ impl Frame {
self.blocks.pop()
}
pub fn last_block(&mut self) -> &Block {
pub fn last_block(&self) -> &Block {
self.blocks.last().unwrap()
}
@@ -96,7 +96,7 @@ impl Frame {
objs
}
pub fn last_value(&mut self) -> PyObjectRef {
pub fn last_value(&self) -> PyObjectRef {
self.stack.last().unwrap().clone()
}
}

View File

@@ -151,8 +151,8 @@ impl VirtualMachine {
self.current_frame_mut().pop_block()
}
fn last_block(&mut self) -> &Block {
self.current_frame_mut().last_block()
fn last_block(&self) -> &Block {
self.current_frame().last_block()
}
fn unwind_loop(&mut self) -> Block {
@@ -195,8 +195,8 @@ impl VirtualMachine {
self.current_frame_mut().pop_multiple(count)
}
fn last_value(&mut self) -> PyObjectRef {
self.current_frame_mut().last_value()
fn last_value(&self) -> PyObjectRef {
self.current_frame().last_value()
}
fn store_name(&mut self, name: &String) -> Option<PyResult> {