Skip to content

Commit a8027ab

Browse files
committed
Fix clippy lints
1 parent f33e2d3 commit a8027ab

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

compiler/src/compile.rs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ pub fn compile(
7878
match mode {
7979
Mode::Exec => {
8080
let ast = parser::parse_program(source)?;
81-
compile_program(ast, source_path.clone(), opts)
81+
compile_program(ast, source_path, opts)
8282
}
8383
Mode::Eval => {
8484
let statement = parser::parse_statement(source)?;
85-
compile_statement_eval(statement, source_path.clone(), opts)
85+
compile_statement_eval(statement, source_path, opts)
8686
}
8787
Mode::Single => {
8888
let ast = parser::parse_program(source)?;
89-
compile_program_single(ast, source_path.clone(), opts)
89+
compile_program_single(ast, source_path, opts)
9090
}
9191
}
9292
}
@@ -2141,12 +2141,7 @@ impl<O: OutputStream> Compiler<O> {
21412141
features: &[ast::ImportSymbol],
21422142
) -> Result<(), CompileError> {
21432143
if self.done_with_future_stmts {
2144-
return Err(CompileError {
2145-
error: CompileErrorType::InvalidFuturePlacement,
2146-
location: self.current_source_location.clone(),
2147-
source_path: self.source_path.clone(),
2148-
statement: None,
2149-
});
2144+
return Err(self.error(CompileErrorType::InvalidFuturePlacement));
21502145
}
21512146
for feature in features {
21522147
match &*feature.symbol {
@@ -2156,12 +2151,7 @@ impl<O: OutputStream> Compiler<O> {
21562151
// "generator_stop" => {}
21572152
// "annotations" => {}
21582153
other => {
2159-
return Err(CompileError {
2160-
error: CompileErrorType::InvalidFutureFeature(other.to_owned()),
2161-
location: self.current_source_location.clone(),
2162-
source_path: self.source_path.clone(),
2163-
statement: None,
2164-
})
2154+
return Err(self.error(CompileErrorType::InvalidFutureFeature(other.to_owned())))
21652155
}
21662156
}
21672157
}

0 commit comments

Comments
 (0)