Skip to content

Commit

Permalink
run rufo
Browse files Browse the repository at this point in the history
  • Loading branch information
kzkn committed Sep 1, 2024
1 parent 914982e commit 2a6abed
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/rufo/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3088,12 +3088,12 @@ def visit_array_pattern(node)
end

left_paren_token, right_paren_token = if current_token_kind == :on_lparen
%i[on_lparen on_rparen]
elsif current_token_kind == :on_lbracket
%i[on_lbracket on_rbracket]
else
[]
end
%i[on_lparen on_rparen]
elsif current_token_kind == :on_lbracket
%i[on_lbracket on_rbracket]
else
[]
end

# pattern is [*]
if !pre_rest && !post_rest && rest == [:var_field, nil]
Expand Down Expand Up @@ -3142,7 +3142,7 @@ def visit_array_pattern(node)
if wrote_comma
consume_space
end

# pattern like `[a,]` will make `rest` as `[:var_field, nil]`
if (var_name_node = rest[1]) || current_token_value == "*"
consume_op "*"
Expand Down

0 comments on commit 2a6abed

Please sign in to comment.