mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
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:
1 parent
d8d9eb8087
commit
340d90a3f9
1 file changed
+2
-2
+2
-2
@@ -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()));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user