File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff 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) )
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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,
You can’t perform that action at this time.
0 commit comments