Skip to content

Commit 46e5f14

Browse files
committed
fix: respect trailing semicolon setting for last statements
1 parent c97996f commit 46e5f14

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/stmt.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ impl<'a> Rewrite for Stmt<'a> {
100100
shape,
101101
self.as_ast_node(),
102102
expr_type,
103-
self.is_last_expr(),
103+
self.is_last,
104104
)
105105
}
106106
}
@@ -110,14 +110,14 @@ fn format_stmt(
110110
shape: Shape,
111111
stmt: &ast::Stmt,
112112
expr_type: ExprType,
113-
is_last_expr: bool,
113+
is_last: bool,
114114
) -> Option<String> {
115115
skip_out_of_file_lines_range!(context, stmt.span());
116116

117117
let result = match stmt.kind {
118118
ast::StmtKind::Local(ref local) => local.rewrite(context, shape),
119119
ast::StmtKind::Expr(ref ex) | ast::StmtKind::Semi(ref ex) => {
120-
let suffix = if semicolon_for_stmt(context, stmt, is_last_expr) {
120+
let suffix = if semicolon_for_stmt(context, stmt, is_last) {
121121
";"
122122
} else {
123123
""

0 commit comments

Comments
 (0)