mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-17 01:51:39 +09:00
Minor clippy fix.
This commit is contained in:
@@ -190,7 +190,7 @@ pub enum Constant {
|
||||
Boolean { value: bool },
|
||||
String { value: String },
|
||||
Bytes { value: Vec<u8> },
|
||||
Code { code: CodeObject },
|
||||
Code { code: Box<CodeObject> },
|
||||
Tuple { elements: Vec<Constant> },
|
||||
None,
|
||||
}
|
||||
|
||||
@@ -603,7 +603,9 @@ impl Compiler {
|
||||
|
||||
self.prepare_decorators(decorator_list)?;
|
||||
self.emit(Instruction::LoadConst {
|
||||
value: bytecode::Constant::Code { code },
|
||||
value: bytecode::Constant::Code {
|
||||
code: Box::new(code),
|
||||
},
|
||||
});
|
||||
self.emit(Instruction::LoadConst {
|
||||
value: bytecode::Constant::String {
|
||||
@@ -653,7 +655,9 @@ impl Compiler {
|
||||
|
||||
let code = self.pop_code_object();
|
||||
self.emit(Instruction::LoadConst {
|
||||
value: bytecode::Constant::Code { code },
|
||||
value: bytecode::Constant::Code {
|
||||
code: Box::new(code),
|
||||
},
|
||||
});
|
||||
self.emit(Instruction::LoadConst {
|
||||
value: bytecode::Constant::String {
|
||||
@@ -1075,7 +1079,9 @@ impl Compiler {
|
||||
self.emit(Instruction::ReturnValue);
|
||||
let code = self.pop_code_object();
|
||||
self.emit(Instruction::LoadConst {
|
||||
value: bytecode::Constant::Code { code },
|
||||
value: bytecode::Constant::Code {
|
||||
code: Box::new(code),
|
||||
},
|
||||
});
|
||||
self.emit(Instruction::LoadConst {
|
||||
value: bytecode::Constant::String { value: name },
|
||||
@@ -1360,7 +1366,9 @@ impl Compiler {
|
||||
|
||||
// List comprehension code:
|
||||
self.emit(Instruction::LoadConst {
|
||||
value: bytecode::Constant::Code { code },
|
||||
value: bytecode::Constant::Code {
|
||||
code: Box::new(code),
|
||||
},
|
||||
});
|
||||
|
||||
// List comprehension function name:
|
||||
|
||||
@@ -716,8 +716,7 @@ impl Frame {
|
||||
let obj = import_module(vm, current_path, module)?;
|
||||
|
||||
for (k, v) in obj.get_key_value_pairs().iter() {
|
||||
&self
|
||||
.scope
|
||||
self.scope
|
||||
.locals
|
||||
.set_item(&vm.ctx, &objstr::get_value(k), v.clone());
|
||||
}
|
||||
|
||||
@@ -682,7 +682,7 @@ impl PyContext {
|
||||
bytecode::Constant::String { ref value } => self.new_str(value.clone()),
|
||||
bytecode::Constant::Bytes { ref value } => self.new_bytes(value.clone()),
|
||||
bytecode::Constant::Boolean { ref value } => self.new_bool(value.clone()),
|
||||
bytecode::Constant::Code { ref code } => self.new_code_object(code.clone()),
|
||||
bytecode::Constant::Code { ref code } => self.new_code_object(*code.clone()),
|
||||
bytecode::Constant::Tuple { ref elements } => {
|
||||
let elements = elements
|
||||
.iter()
|
||||
|
||||
Reference in New Issue
Block a user