Refactor push_code_object to push_new_code_object

The argument wasn't being used by the current implementation, so drop
it.
This commit is contained in:
Daniel Watkins
2018-08-10 15:56:28 -04:00
parent d8d9eb8087
commit 340d90a3f9

View File

@@ -16,7 +16,7 @@ struct Compiler {
pub fn compile(vm: &mut VirtualMachine, source: &String, mode: Mode) -> Result<PyObjectRef, String> {
let mut compiler = Compiler::new();
compiler.push_code_object(CodeObject::new(Vec::new()));
compiler.push_new_code_object();
match mode {
Mode::Exec => match parser::parse_program(source) {
Ok(ast) => {
@@ -77,7 +77,7 @@ impl Compiler {
}
}
fn push_code_object(&mut self, code_object: CodeObject) {
fn push_new_code_object(&mut self) {
self.code_object_stack.push(CodeObject::new(Vec::new()));
}