Skip to content

Commit 04689da

Browse files
committed
[core][rewriter] cargo fmt
1 parent 9b5bba5 commit 04689da

File tree

1 file changed

+31
-32
lines changed

1 file changed

+31
-32
lines changed

rewriter/js/src/visitor.rs

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -458,28 +458,27 @@ where
458458
.add(rewrite!(Span::new(start, start), ScramErr { ident }));
459459
}
460460

461-
if !self.flags.destructure_rewrites {
462-
walk::walk_try_statement(self, it);
463-
return;
464-
}
465-
466-
dbg!(&it);
467-
if let Some(h) = &it.handler {
468-
if let Some(p) = &h.param {
469-
let mut restids: Vec<Atom<'data>> = Vec::new();
470-
let mut location_assigned: bool = false;
471-
472-
self.recurse_binding_pattern(&p.pattern, &mut restids, &mut location_assigned);
473-
self.jschanges.add(rewrite!(
474-
h.body.body[0].span(),
475-
CleanFunction {
476-
restids,
477-
expression: false,
478-
}
479-
));
480-
}
481-
}
461+
if !self.flags.destructure_rewrites {
462+
walk::walk_try_statement(self, it);
463+
return;
464+
}
482465

466+
dbg!(&it);
467+
if let Some(h) = &it.handler {
468+
if let Some(p) = &h.param {
469+
let mut restids: Vec<Atom<'data>> = Vec::new();
470+
let mut location_assigned: bool = false;
471+
472+
self.recurse_binding_pattern(&p.pattern, &mut restids, &mut location_assigned);
473+
self.jschanges.add(rewrite!(
474+
h.body.body[0].span(),
475+
CleanFunction {
476+
restids,
477+
expression: false,
478+
}
479+
));
480+
}
481+
}
483482
}
484483

485484
fn visit_object_expression(&mut self, it: &ObjectExpression<'data>) {
@@ -613,29 +612,29 @@ where
613612
}
614613

615614
fn visit_variable_declaration(&mut self, it: &oxc::ast::ast::VariableDeclaration<'data>) {
616-
if !self.flags.destructure_rewrites {
615+
if !self.flags.destructure_rewrites {
617616
walk::walk_variable_declaration(self, it);
618617
return;
619618
}
620619

621-
let mut restids: Vec<Atom<'data>> = Vec::new();
622-
let mut location_assigned: bool = false;
620+
let mut restids: Vec<Atom<'data>> = Vec::new();
621+
let mut location_assigned: bool = false;
623622

624-
for declaration in &it.declarations {
625-
if let Some(e) = &declaration.init {
626-
walk::walk_expression(self, e);
627-
}
628-
self.recurse_binding_pattern(&declaration.id, &mut restids, &mut location_assigned);
629-
}
623+
for declaration in &it.declarations {
624+
if let Some(e) = &declaration.init {
625+
walk::walk_expression(self, e);
626+
}
627+
self.recurse_binding_pattern(&declaration.id, &mut restids, &mut location_assigned);
628+
}
630629

631-
self.jschanges.add(rewrite!(
630+
self.jschanges.add(rewrite!(
632631
Span::new(it.span.end, it.span.end),
633632
CleanFunction {
634633
restids,
635634
expression: false,
636635
}
637636
));
638-
}
637+
}
639638

640639
fn visit_assignment_expression(&mut self, it: &AssignmentExpression<'data>) {
641640
match &it.left {

0 commit comments

Comments
 (0)