Skip to content

Commit 66a0001

Browse files
committedApr 3, 2025·
style(all): remove unnecessary semi-colons (#10198)
Remove unnecessary semi-colons. Flagged by clippy in Rust 1.86.0.
1 parent 760188e commit 66a0001

File tree

40 files changed

+81
-83
lines changed

40 files changed

+81
-83
lines changed
 

Diff for: ‎apps/oxlint/src/lint.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl Runner for LintRunner {
156156
}) {
157157
stdout.write_all(end.as_bytes()).or_else(Self::check_for_writer_error).unwrap();
158158
stdout.flush().unwrap();
159-
};
159+
}
160160

161161
return CliRunResult::LintNoFilesFound;
162162
}
@@ -391,7 +391,7 @@ impl Runner for LintRunner {
391391
}) {
392392
stdout.write_all(end.as_bytes()).or_else(Self::check_for_writer_error).unwrap();
393393
stdout.flush().unwrap();
394-
};
394+
}
395395

396396
if diagnostic_result.errors_count() > 0 {
397397
CliRunResult::LintFoundErrors

Diff for: ‎crates/oxc_ast/src/ast_impl/literal.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl StringLiteral<'_> {
8989
if (0xd800..=0xdfff).contains(&hex) {
9090
return false;
9191
}
92-
};
92+
}
9393
}
9494
}
9595
true

Diff for: ‎crates/oxc_cfg/src/dot.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl DisplayDot for ControlFlowGraph {
3434
attrs += ("style", "dotted");
3535
} else if matches!(weight, EdgeType::Error(_)) {
3636
attrs += ("color", "red");
37-
};
37+
}
3838

3939
format!("{attrs:?}")
4040
},

Diff for: ‎crates/oxc_codegen/src/gen.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ impl Gen for ImportAttribute<'_> {
995995
ImportAttributeKey::StringLiteral(literal) => {
996996
p.print_string_literal(literal, false);
997997
}
998-
};
998+
}
999999
p.print_colon();
10001000
p.print_soft_space();
10011001
p.print_string_literal(&self.value, false);
@@ -1105,7 +1105,7 @@ impl Gen for ModuleExportName<'_> {
11051105
Self::IdentifierName(ident) => ident.print(p, ctx),
11061106
Self::IdentifierReference(ident) => ident.print(p, ctx),
11071107
Self::StringLiteral(literal) => p.print_string_literal(literal, false),
1108-
};
1108+
}
11091109
}
11101110
}
11111111

Diff for: ‎crates/oxc_codegen/src/sourcemap_builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ impl SourcemapBuilder {
416416

417417
break 'lines;
418418
}
419-
};
419+
}
420420

421421
// Line break found.
422422
// `byte_offset_from_line_start` is now the length of line *including* line break.

Diff for: ‎crates/oxc_diagnostics/src/reporter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl Info {
131131

132132
if let Some(name) = span_content.name() {
133133
filename = name.to_string();
134-
};
134+
}
135135
if matches!(diagnostic.severity(), Some(Severity::Error)) {
136136
severity = Severity::Error;
137137
}

Diff for: ‎crates/oxc_formatter/src/formatter/buffer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ fn clean_interned(
581581
most_flat.iter().rev().for_each(|element| element_stack.push(element));
582582
}
583583
element => cleaned.push(element.clone()),
584-
};
584+
}
585585
}
586586

587587
Interned::new(cleaned)

Diff for: ‎crates/oxc_formatter/src/formatter/printer/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ impl<'a> Printer<'a> {
203203
match mode {
204204
DedentMode::Level => indent_stack.start_dedent(),
205205
DedentMode::Root => indent_stack.reset_indent(),
206-
};
206+
}
207207
stack.push(TagKind::Dedent, args);
208208
}
209209

@@ -281,10 +281,10 @@ impl<'a> Printer<'a> {
281281
match mode {
282282
DedentMode::Level => indent_stack.end_dedent(),
283283
DedentMode::Root => indent_stack.pop(),
284-
};
284+
}
285285
stack.pop(tag.kind())?;
286286
}
287-
};
287+
}
288288

289289
Ok(())
290290
}
@@ -1102,7 +1102,7 @@ impl<'a, 'print> FitsMeasurer<'a, 'print> {
11021102
match mode {
11031103
DedentMode::Level => self.indent_stack.start_dedent(),
11041104
DedentMode::Root => self.indent_stack.reset_indent(),
1105-
};
1105+
}
11061106
self.stack.push(TagKind::Dedent, args);
11071107
}
11081108

Diff for: ‎crates/oxc_formatter/src/formatter/trivia.rs

+18-20
Original file line numberDiff line numberDiff line change
@@ -65,26 +65,24 @@ impl Format<'_> for FormatLeadingComments<'_> {
6565
write!(f, [comment])?;
6666

6767
match comment.kind() {
68-
CommentKind::Block | CommentKind::InlineBlock => {
69-
match comment.lines_after() {
70-
0 => {
71-
let should_nestle =
72-
leading_comments_iter.peek().is_some_and(|next_comment| {
73-
should_nestle_adjacent_doc_comments(comment, next_comment)
74-
});
75-
76-
write!(f, [maybe_space(!should_nestle)])?;
68+
CommentKind::Block | CommentKind::InlineBlock => match comment.lines_after() {
69+
0 => {
70+
let should_nestle =
71+
leading_comments_iter.peek().is_some_and(|next_comment| {
72+
should_nestle_adjacent_doc_comments(comment, next_comment)
73+
});
74+
75+
write!(f, [maybe_space(!should_nestle)])?;
76+
}
77+
1 => {
78+
if comment.lines_before() == 0 {
79+
write!(f, [soft_line_break_or_space()])?;
80+
} else {
81+
write!(f, [hard_line_break()])?;
7782
}
78-
1 => {
79-
if comment.lines_before() == 0 {
80-
write!(f, [soft_line_break_or_space()])?;
81-
} else {
82-
write!(f, [hard_line_break()])?;
83-
}
84-
}
85-
_ => write!(f, [empty_line()])?,
86-
};
87-
}
83+
}
84+
_ => write!(f, [empty_line()])?,
85+
},
8886
CommentKind::Line => match comment.lines_after() {
8987
0 | 1 => write!(f, [hard_line_break()])?,
9088
_ => write!(f, [empty_line()])?,
@@ -165,7 +163,7 @@ impl Format<'_> for FormatTrailingComments<'_> {
165163
}
166164
1 => write!(f, [hard_line_break()])?,
167165
_ => write!(f, [empty_line()])?,
168-
};
166+
}
169167

170168
write!(f, [comment])
171169
})),

Diff for: ‎crates/oxc_isolated_declarations/src/class.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ impl<'a> IsolatedDeclarations<'a> {
333333
}
334334
}
335335
_ => continue,
336-
};
336+
}
337337
}
338338
}
339339

Diff for: ‎crates/oxc_isolated_declarations/src/signatures.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl<'a> IsolatedDeclarations<'a> {
3939
entry.0 |= method.return_type.is_none();
4040
entry.2 = Some(&mut method.return_type);
4141
}
42-
};
42+
}
4343
}
4444
});
4545

Diff for: ‎crates/oxc_language_server/src/linter/isolated_lint_handler.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl IsolatedLintHandler {
133133
})
134134
.collect();
135135
return Some(Self::wrap_diagnostics(path, &source_text, reports, start));
136-
};
136+
}
137137

138138
let semantic_ret = SemanticBuilder::new()
139139
.with_cfg(true)
@@ -151,7 +151,7 @@ impl IsolatedLintHandler {
151151
})
152152
.collect();
153153
return Some(Self::wrap_diagnostics(path, &source_text, reports, start));
154-
};
154+
}
155155

156156
let mut semantic = semantic_ret.semantic;
157157
semantic.set_irregular_whitespaces(ret.irregular_whitespaces);

Diff for: ‎crates/oxc_minifier/src/peephole/fold_constants.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl<'a> PeepholeOptimizations {
4242
} {
4343
*expr = folded_expr;
4444
state.changed = true;
45-
};
45+
}
4646
}
4747

4848
#[expect(clippy::float_cmp)]

Diff for: ‎crates/oxc_minifier/src/peephole/minimize_conditions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<'a> PeepholeOptimizations {
5151
} {
5252
*expr = folded_expr;
5353
local_change = true;
54-
};
54+
}
5555
if local_change {
5656
changed = true;
5757
} else {

Diff for: ‎crates/oxc_minifier/src/peephole/minimize_for_statement.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl<'a> PeepholeOptimizations {
2121
} else {
2222
return;
2323
}
24-
};
24+
}
2525

2626
let Statement::IfStatement(if_stmt) = first else {
2727
return;

Diff for: ‎crates/oxc_minifier/src/peephole/minimize_statements.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl<'a> PeepholeOptimizations {
6262
.is_break()
6363
{
6464
break;
65-
};
65+
}
6666
}
6767
if let Some(stmt) = keep_var.get_variable_declaration_statement() {
6868
result.push(stmt);

Diff for: ‎crates/oxc_minifier/src/peephole/remove_dead_code.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ impl<'a, 'b> PeepholeOptimizations {
205205
}
206206
} else {
207207
keep_var.visit_statement(&if_stmt.consequent);
208-
};
208+
}
209209
let var_stmt = keep_var.get_variable_declaration_statement();
210210
let has_var_stmt = var_stmt.is_some();
211211
if let Some(var_stmt) = var_stmt {

Diff for: ‎crates/oxc_minifier/src/peephole/replace_known_methods.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ impl<'a> PeepholeOptimizations {
176176
if start > end {
177177
return None;
178178
}
179-
};
179+
}
180180
Some(ctx.ast.expression_string_literal(
181181
span,
182182
s.value.as_str().substring(start_idx, end_idx),

Diff for: ‎crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ impl<'a> PeepholeOptimizations {
923923
*computed = false;
924924
}
925925
return;
926-
};
926+
}
927927
let PropertyKey::StringLiteral(s) = key else { return };
928928
let value = s.value.as_str();
929929
if is_identifier_name(value) {
@@ -1177,7 +1177,7 @@ impl<'a> LatePeepholeOptimizations {
11771177
{
11781178
catch.param = None;
11791179
}
1180-
};
1180+
}
11811181
}
11821182
}
11831183
}

Diff for: ‎crates/oxc_parser/src/js/module.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ impl<'a> ParserImpl<'a> {
127127
} else if self.at(Kind::LCurly) {
128128
let mut import_specifiers = self.parse_import_specifiers()?;
129129
specifiers.append(&mut import_specifiers);
130-
};
130+
}
131131

132132
self.expect(Kind::From)?;
133133
Ok(specifiers)
@@ -505,7 +505,7 @@ impl<'a> ParserImpl<'a> {
505505
// It is a Syntax Error if IsStringWellFormedUnicode(the SV of StringLiteral) is false.
506506
if literal.lone_surrogates || !literal.is_string_well_formed_unicode() {
507507
self.error(diagnostics::export_lone_surrogate(literal.span));
508-
};
508+
}
509509
Ok(ModuleExportName::StringLiteral(literal))
510510
}
511511
_ => Ok(ModuleExportName::IdentifierName(self.parse_identifier_name()?)),

Diff for: ‎crates/oxc_parser/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ impl<'a> ParserImpl<'a> {
534534
fn flow_error(&mut self) -> Option<OxcDiagnostic> {
535535
if !self.source_type.is_javascript() {
536536
return None;
537-
};
537+
}
538538
let span = self.lexer.trivia_builder.comments.first()?.span;
539539
if span.source_text(self.source_text).contains("@flow") {
540540
self.errors.clear();

Diff for: ‎crates/oxc_semantic/src/binder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ impl<'a> Binder<'a> for Function<'a> {
188188
PropertyKind::Get => *flags |= ScopeFlags::GetAccessor,
189189
PropertyKind::Set => *flags |= ScopeFlags::SetAccessor,
190190
PropertyKind::Init => {}
191-
};
191+
}
192192
}
193193

194194
// Save `@__NO_SIDE_EFFECTS__`

Diff for: ‎crates/oxc_semantic/src/checker/javascript.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ pub fn check_function_declaration<'a>(
429429
} else if !is_if_stmt_or_labeled_stmt {
430430
ctx.error(function_declaration_non_strict(decl.span));
431431
}
432-
};
432+
}
433433
}
434434

435435
// It is a Syntax Error if IsLabelledFunction(Statement) is true.
@@ -460,7 +460,7 @@ pub fn check_function_declaration_in_labeled_statement<'a>(
460460
}
461461
ctx.error(function_declaration_non_strict(decl.span));
462462
}
463-
};
463+
}
464464
}
465465

466466
// It is a Syntax Error if any element of the LexicallyDeclaredNames of
@@ -890,7 +890,7 @@ pub fn check_super<'a>(sup: &Super, node: &AstNode<'a>, ctx: &SemanticBuilder<'a
890890
ctx.error(unexpected_super_call(super_call_span));
891891
}
892892
return;
893-
};
893+
}
894894
}
895895

896896
// ModuleBody : ModuleItemList

Diff for: ‎crates/oxc_semantic/src/checker/typescript.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ pub fn check_class<'a>(class: &Class<'a>, ctx: &SemanticBuilder<'a>) {
372372
ctx.error(constructor_implementation_missing(a.key.span()));
373373
} else {
374374
ctx.error(function_implementation_missing(a.key.span()));
375-
};
375+
}
376376
}
377377
}
378378
}

Diff for: ‎crates/oxc_semantic/src/class/table.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl<'a> ClassTable<'a> {
107107
let class_id = self.declarations.push(node_id);
108108
if let Some(parent_id) = parent_id {
109109
self.parent_ids.insert(class_id, parent_id);
110-
};
110+
}
111111
self.elements.push(IndexVec::default());
112112
self.private_identifier_references.push(Vec::new());
113113
class_id

Diff for: ‎crates/oxc_semantic/tests/integration/util/class_tester.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ impl<'a> ClassTester<'a> {
1717

1818
if class.id.clone().is_some_and(|id| id.name == name) {
1919
return Some(class_id);
20-
};
20+
}
2121

2222
None
2323
});

Diff for: ‎crates/oxc_transformer/src/common/arrow_function_converter.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ impl<'a> Traverse<'a> for ArrowFunctionConverter<'a> {
361361
if let Some(ident) = self.get_this_identifier(this.span, ctx) {
362362
*element_name = JSXElementName::IdentifierReference(ident);
363363
}
364-
};
364+
}
365365
}
366366

367367
fn enter_jsx_member_expression_object(
@@ -921,7 +921,7 @@ impl<'a> ArrowFunctionConverter<'a> {
921921
param_binding.create_read_expression(ctx),
922922
false,
923923
));
924-
};
924+
}
925925

926926
// Create a parameter for the value if it's an assignment.
927927
if is_assignment {

Diff for: ‎crates/oxc_transformer/src/decorator/legacy/metadata.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ impl<'a> LegacyDecoratorMetadata<'a, '_> {
457457
return Self::global_object(ctx);
458458
}
459459
_ => {}
460-
};
460+
}
461461

462462
let serialized_constituent = self.serialize_type_node(t, ctx);
463463
if matches!(&serialized_constituent, Expression::Identifier(ident) if ident.name == "Object")

Diff for: ‎crates/oxc_transformer/src/decorator/legacy/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ impl<'a> Traverse<'a> for LegacyDecorator<'a, '_> {
116116
self.transform_export_default_class(stmt, ctx);
117117
}
118118
_ => {}
119-
};
119+
}
120120
}
121121

122122
#[inline]
@@ -340,7 +340,7 @@ impl<'a> LegacyDecorator<'a, '_> {
340340
has_private_in_expression_in_decorator,
341341
ctx,
342342
);
343-
};
343+
}
344344
}
345345

346346
/// Transforms a decorated class declaration and appends the resulting statements. If

Diff for: ‎crates/oxc_transformer/src/es2018/object_rest_spread.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ impl<'a> ObjectRestSpread<'a, '_> {
195195
// Allow `{...x} = {}` and `[{...x}] = []`.
196196
if !Self::has_nested_target_rest(&assign_expr.left) {
197197
return;
198-
};
198+
}
199199

200200
// If not an top `({ ...y })`, walk the pattern and create references for all the objects with a rest.
201201
if !matches!(&assign_expr.left, AssignmentTarget::ObjectAssignmentTarget(t) if t.rest.is_some())

Diff for: ‎crates/oxc_transformer/src/es2020/optional_chaining.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl<'a> Traverse<'a> for OptionalChaining<'a, '_> {
101101
self.transform_update_expression(expr, ctx);
102102
}
103103
_ => {}
104-
};
104+
}
105105
}
106106

107107
// `#[inline]` because this is a hot path
@@ -335,14 +335,14 @@ impl<'a> OptionalChaining<'a, '_> {
335335
// ^^^^^^ ^^^^^^^^ Here we will wrap the right part with a `delete` unary expression
336336
if is_delete {
337337
chain_expr = ctx.ast.expression_unary(SPAN, UnaryOperator::Delete, chain_expr);
338-
};
338+
}
339339

340340
// If this chain expression is a callee of a CallExpression, we need to transform it to accept a proper context
341341
// `(Foo?.["m"])();` -> `(... _Foo["m"].bind(_Foo))();`
342342
// ^^^^^^^^^^^ Here we will handle the `right` part to bind a proper context
343343
if matches!(ctx.ancestor(1), Ancestor::CallExpressionCallee(_)) {
344344
chain_expr = self.transform_expression_to_bind_context(chain_expr, ctx);
345-
};
345+
}
346346
// Clear states
347347
self.temp_binding = None;
348348
self.call_context = CallContext::None;

Diff for: ‎crates/oxc_transformer/src/es2022/class_properties/instance_prop_init.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl<'a> ClassProperties<'a, '_> {
3535
// No symbol clashes possible. Just re-parent first-level scopes (faster).
3636
let mut updater = FastInstanceInitializerVisitor::new(self, ctx);
3737
updater.visit_expression(value);
38-
};
38+
}
3939
}
4040
}
4141

Diff for: ‎crates/oxc_transformer/src/es2022/class_properties/private_field.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ impl<'a> ClassProperties<'a, '_> {
247247
let Expression::CallExpression(call_expr) = expr else { unreachable!() };
248248
if matches!(&call_expr.callee, Expression::PrivateFieldExpression(_)) {
249249
self.transform_call_expression_impl(call_expr, ctx);
250-
};
250+
}
251251
}
252252

253253
fn transform_call_expression_impl(
@@ -466,7 +466,7 @@ impl<'a> ClassProperties<'a, '_> {
466466
let Expression::AssignmentExpression(assign_expr) = expr else { unreachable!() };
467467
if matches!(&assign_expr.left, AssignmentTarget::PrivateFieldExpression(_)) {
468468
self.transform_assignment_expression_impl(expr, ctx);
469-
};
469+
}
470470
}
471471

472472
fn transform_assignment_expression_impl(
@@ -906,7 +906,7 @@ impl<'a> ClassProperties<'a, '_> {
906906
let Expression::UpdateExpression(update_expr) = expr else { unreachable!() };
907907
if matches!(&update_expr.argument, SimpleAssignmentTarget::PrivateFieldExpression(_)) {
908908
self.transform_update_expression_impl(expr, ctx);
909-
};
909+
}
910910
}
911911

912912
// TODO: Split up this function into 2 halves for static and instance props

Diff for: ‎crates/oxc_transformer/src/es2022/class_properties/super_converter.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl<'a> ClassPropertiesSuperConverter<'a, '_, '_> {
113113
self.transform_call_expression_for_super_computed_member_expr(call_expr, ctx);
114114
}
115115
_ => {}
116-
};
116+
}
117117
}
118118

119119
fn transform_call_expression_for_super_static_member_expr(
@@ -182,7 +182,7 @@ impl<'a> ClassPropertiesSuperConverter<'a, '_, '_> {
182182
self.transform_assignment_expression_for_super_computed_member_expr(expr, ctx);
183183
}
184184
_ => {}
185-
};
185+
}
186186
}
187187

188188
/// Transform assignment expression where the left-hand side is a static member expression
@@ -320,7 +320,7 @@ impl<'a> ClassPropertiesSuperConverter<'a, '_, '_> {
320320
self.transform_update_expression_for_super_computed_member_expr(expr, ctx);
321321
}
322322
_ => {}
323-
};
323+
}
324324
}
325325

326326
/// Transform update expression (`++` or `--`) where argument is a static member expression

Diff for: ‎crates/oxc_transformer/src/jsx/jsx_impl.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ impl<'a, 'ctx> AutomaticScriptBindings<'a, 'ctx> {
190190
if self.is_development { "reactJsxDevRuntime" } else { "reactJsxRuntime" };
191191
let id = self.add_require_statement(var_name, self.jsx_runtime_importer, false, ctx);
192192
self.require_jsx = Some(id);
193-
};
193+
}
194194
self.require_jsx.as_ref().unwrap().create_read_reference(ctx)
195195
}
196196

@@ -261,7 +261,7 @@ impl<'a, 'ctx> AutomaticModuleBindings<'a, 'ctx> {
261261
self.add_import_jsx_dev(ctx);
262262
} else {
263263
self.import_jsx = Some(self.add_jsx_import_statement("jsx", ctx));
264-
};
264+
}
265265
}
266266
self.import_jsx.as_ref().unwrap().create_read_reference(ctx)
267267
}
@@ -272,7 +272,7 @@ impl<'a, 'ctx> AutomaticModuleBindings<'a, 'ctx> {
272272
self.add_import_jsx_dev(ctx);
273273
} else {
274274
self.import_jsxs = Some(self.add_jsx_import_statement("jsxs", ctx));
275-
};
275+
}
276276
}
277277
self.import_jsxs.as_ref().unwrap().create_read_reference(ctx)
278278
}

Diff for: ‎crates/oxc_transformer/src/options/babel/env/targets.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl TryFrom<BabelTargets> for EngineTargets {
4848
// TODO: Implement `Version::from_number`
4949
if matches!(value, BabelTargetsValue::Int(_) | BabelTargetsValue::Float(_)) {
5050
continue;
51-
};
51+
}
5252
let BabelTargetsValue::String(v) = value else {
5353
return Err(format!("{value:?} is not a string for {key}."));
5454
};

Diff for: ‎crates/oxc_transformer/src/proposals/explicit_resource_management.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl<'a> Traverse<'a> for ExplicitResourceManagement<'a, '_> {
133133

134134
let new_body = ctx.ast.vec_from_array([using_stmt, old_body]);
135135
for_of_stmt.body = ctx.ast.statement_block_with_scope_id(SPAN, new_body, scope_id);
136-
};
136+
}
137137
}
138138

139139
/// Transform class static block.
@@ -519,7 +519,7 @@ impl<'a> ExplicitResourceManagement<'a, '_> {
519519
VariableDeclarationKind::Using | VariableDeclarationKind::AwaitUsing
520520
) {
521521
continue;
522-
};
522+
}
523523
needs_await = needs_await || var_decl.kind == VariableDeclarationKind::AwaitUsing;
524524

525525
var_decl.kind = VariableDeclarationKind::Const;
@@ -642,7 +642,7 @@ impl<'a> ExplicitResourceManagement<'a, '_> {
642642
) && !self.top_level_using.contains_key(&address)
643643
{
644644
continue;
645-
};
645+
}
646646
let is_await_using = variable_declaration.kind == VariableDeclarationKind::AwaitUsing
647647
|| self.top_level_using.get(&address).copied().unwrap_or(false);
648648
needs_await = needs_await || is_await_using;

Diff for: ‎crates/oxc_transformer/src/typescript/enum.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ impl IdentifierReferenceRename<'_, '_> {
567567
// Don't need to rename the identifier if it's not a member of the enum,
568568
if !self.previous_enum_members.contains_key(&ident.name) {
569569
return false;
570-
};
570+
}
571571

572572
let scoping = self.ctx.scoping.scoping();
573573
let Some(symbol_id) = scoping.get_reference(ident.reference_id()).symbol_id() else {
@@ -625,6 +625,6 @@ impl<'a> VisitMut<'a> for IdentifierReferenceRename<'a, '_> {
625625
_ => {
626626
walk_mut::walk_expression(self, expr);
627627
}
628-
};
628+
}
629629
}
630630
}

Diff for: ‎tasks/coverage/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ fn main() {
3333
args.run_runtime();
3434
}
3535
_ => args.run_default(),
36-
};
36+
}
3737
}

Diff for: ‎tasks/prettier_conformance/src/spec.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,14 @@ impl VisitMut<'_> for SpecParser {
172172
}
173173
}
174174
_ => {}
175-
};
175+
}
176176
if name != "errors" {
177177
snapshot_options.push((
178178
name.to_string(),
179179
obj_prop.value.span().source_text(&self.source_text).to_string(),
180180
));
181181
}
182-
};
182+
}
183183
}
184184
});
185185
}

0 commit comments

Comments
 (0)
Please sign in to comment.