fix(oxc_ast,oxc_parser): fix clippy warnings

This commit is contained in:
Boshen 2023-04-22 16:24:50 +08:00
parent f382d36375
commit 08dfbc98b2
No known key found for this signature in database
GPG key ID: 9C7A8C8AB22BEBD1
2 changed files with 5 additions and 5 deletions

View file

@ -49,11 +49,11 @@ impl<'a> AstBuilder<'a> {
pub fn program(
&self,
span: Span,
source_type: SourceType,
directives: Vec<'a, Directive>,
body: Vec<'a, Statement<'a>>,
source_type: SourceType,
) -> Program<'a> {
Program { span, directives, body, source_type }
Program { span, source_type, directives, body }
}
/* ---------- Literals ---------- */

View file

@ -171,9 +171,9 @@ impl<'a> Parser<'a> {
self.error(self.flow_error().unwrap_or(error));
let program = self.ast.program(
Span::default(),
self.ast.new_vec(),
self.ast.new_vec(),
self.source_type,
self.ast.new_vec(),
self.ast.new_vec(),
);
(program, true)
}
@ -192,7 +192,7 @@ impl<'a> Parser<'a> {
self.parse_directives_and_statements(/* is_top_level */ true)?;
let span = Span::new(0, self.source_text.len() as u32);
Ok(self.ast.program(span, directives, statements, self.source_type))
Ok(self.ast.program(span, self.source_type, directives, statements))
}
#[must_use]