@@ -262,7 +262,7 @@ impl<O: OutputStream> Compiler<O> {
262262 return Err ( CompileError {
263263 statement : None ,
264264 error : CompileErrorType :: ExpectExpr ,
265- location : statement. location . clone ( ) ,
265+ location : statement. location ,
266266 source_path : None ,
267267 } ) ;
268268 }
@@ -306,7 +306,7 @@ impl<O: OutputStream> Compiler<O> {
306306
307307 fn compile_statement ( & mut self , statement : & ast:: Statement ) -> Result < ( ) , CompileError > {
308308 trace ! ( "Compiling {:?}" , statement) ;
309- self . set_source_location ( & statement. location ) ;
309+ self . set_source_location ( statement. location ) ;
310310 use ast:: StatementType :: * ;
311311
312312 match & statement. node {
@@ -542,7 +542,7 @@ impl<O: OutputStream> Compiler<O> {
542542 return Err ( CompileError {
543543 statement : None ,
544544 error : CompileErrorType :: InvalidBreak ,
545- location : statement. location . clone ( ) ,
545+ location : statement. location ,
546546 source_path : None ,
547547 } ) ;
548548 }
@@ -553,7 +553,7 @@ impl<O: OutputStream> Compiler<O> {
553553 return Err ( CompileError {
554554 statement : None ,
555555 error : CompileErrorType :: InvalidContinue ,
556- location : statement. location . clone ( ) ,
556+ location : statement. location ,
557557 source_path : None ,
558558 } ) ;
559559 }
@@ -564,7 +564,7 @@ impl<O: OutputStream> Compiler<O> {
564564 return Err ( CompileError {
565565 statement : None ,
566566 error : CompileErrorType :: InvalidReturn ,
567- location : statement. location . clone ( ) ,
567+ location : statement. location ,
568568 source_path : None ,
569569 } ) ;
570570 }
@@ -643,7 +643,7 @@ impl<O: OutputStream> Compiler<O> {
643643 return Err ( CompileError {
644644 statement : None ,
645645 error : CompileErrorType :: Delete ( expression. name ( ) ) ,
646- location : self . current_source_location . clone ( ) ,
646+ location : self . current_source_location ,
647647 source_path : None ,
648648 } ) ;
649649 }
@@ -1348,7 +1348,7 @@ impl<O: OutputStream> Compiler<O> {
13481348 return Err ( CompileError {
13491349 statement : None ,
13501350 error : CompileErrorType :: StarArgs ,
1351- location : self . current_source_location . clone ( ) ,
1351+ location : self . current_source_location ,
13521352 source_path : None ,
13531353 } ) ;
13541354 } else {
@@ -1379,7 +1379,7 @@ impl<O: OutputStream> Compiler<O> {
13791379 return Err ( CompileError {
13801380 statement : None ,
13811381 error : CompileErrorType :: Assign ( target. name ( ) ) ,
1382- location : self . current_source_location . clone ( ) ,
1382+ location : self . current_source_location ,
13831383 source_path : None ,
13841384 } ) ;
13851385 }
@@ -1570,7 +1570,7 @@ impl<O: OutputStream> Compiler<O> {
15701570
15711571 fn compile_expression ( & mut self , expression : & ast:: Expression ) -> Result < ( ) , CompileError > {
15721572 trace ! ( "Compiling {:?}" , expression) ;
1573- self . set_source_location ( & expression. location ) ;
1573+ self . set_source_location ( expression. location ) ;
15741574
15751575 use ast:: ExpressionType :: * ;
15761576 match & expression. node {
@@ -1665,7 +1665,7 @@ impl<O: OutputStream> Compiler<O> {
16651665 return Err ( CompileError {
16661666 statement : Option :: None ,
16671667 error : CompileErrorType :: InvalidYield ,
1668- location : self . current_source_location . clone ( ) ,
1668+ location : self . current_source_location ,
16691669 source_path : Option :: None ,
16701670 } ) ;
16711671 }
@@ -1763,7 +1763,7 @@ impl<O: OutputStream> Compiler<O> {
17631763 error : CompileErrorType :: SyntaxError ( std:: string:: String :: from (
17641764 "Invalid starred expression" ,
17651765 ) ) ,
1766- location : self . current_source_location . clone ( ) ,
1766+ location : self . current_source_location ,
17671767 source_path : Option :: None ,
17681768 } ) ;
17691769 }
@@ -2182,8 +2182,8 @@ impl<O: OutputStream> Compiler<O> {
21822182 self . current_output ( ) . set_label ( label)
21832183 }
21842184
2185- fn set_source_location ( & mut self , location : & ast:: Location ) {
2186- self . current_source_location = location. clone ( ) ;
2185+ fn set_source_location ( & mut self , location : ast:: Location ) {
2186+ self . current_source_location = location;
21872187 }
21882188
21892189 fn get_source_line_number ( & mut self ) -> usize {
0 commit comments