Skip to content

Commit 3e628e9

Browse files
committed
clippy
1 parent 735f172 commit 3e628e9

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

compiler/codegen/src/ir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ impl CodeInfo {
182182
*arg = new_arg;
183183
}
184184
let (extras, lo_arg) = arg.split();
185-
locations.extend(std::iter::repeat_n(info.location.clone(), arg.instr_size()));
185+
locations.extend(std::iter::repeat_n(info.location, arg.instr_size()));
186186
instructions.extend(
187187
extras
188188
.map(|byte| CodeUnit::new(Instruction::ExtendedArg, byte))

compiler/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ impl CompileError {
5757

5858
pub fn location(&self) -> Option<SourceLocation> {
5959
match self {
60-
Self::Codegen(codegen_error) => codegen_error.location.clone(),
61-
Self::Parse(parse_error) => Some(parse_error.location.clone()),
60+
Self::Codegen(codegen_error) => codegen_error.location,
61+
Self::Parse(parse_error) => Some(parse_error.location),
6262
}
6363
}
6464

vm/src/frame.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ impl Frame {
171171
}
172172

173173
pub fn current_location(&self) -> SourceLocation {
174-
self.code.locations[self.lasti() as usize - 1].clone()
174+
self.code.locations[self.lasti() as usize - 1]
175175
}
176176

177177
pub fn lasti(&self) -> u32 {
@@ -388,7 +388,7 @@ impl ExecutingFrame<'_> {
388388
// 2. Add new entry with current execution position (filename, lineno, code_object) to traceback.
389389
// 3. Unwind block stack till appropriate handler is found.
390390

391-
let loc = frame.code.locations[idx].clone();
391+
let loc = frame.code.locations[idx];
392392
let next = exception.__traceback__();
393393
let new_traceback = PyTraceback::new(
394394
next,

0 commit comments

Comments
 (0)