Skip to content

Commit

Permalink
fix: respect trailing semicolon setting for last statements
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin committed Jun 4, 2024
1 parent c97996f commit 46e5f14
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/stmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl<'a> Rewrite for Stmt<'a> {
shape,
self.as_ast_node(),
expr_type,
self.is_last_expr(),
self.is_last,
)
}
}
Expand All @@ -110,14 +110,14 @@ fn format_stmt(
shape: Shape,
stmt: &ast::Stmt,
expr_type: ExprType,
is_last_expr: bool,
is_last: bool,
) -> Option<String> {
skip_out_of_file_lines_range!(context, stmt.span());

let result = match stmt.kind {
ast::StmtKind::Local(ref local) => local.rewrite(context, shape),
ast::StmtKind::Expr(ref ex) | ast::StmtKind::Semi(ref ex) => {
let suffix = if semicolon_for_stmt(context, stmt, is_last_expr) {
let suffix = if semicolon_for_stmt(context, stmt, is_last) {
";"
} else {
""
Expand Down

0 comments on commit 46e5f14

Please sign in to comment.