Skip to content

Commit aa69148

Browse files
WaffleLapkincalebcartwright
authored andcommitted
Implement become expression formatting in rustfmt
1 parent 1de65a2 commit aa69148

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

Diff for: src/expr.rs

+1
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ pub(crate) fn format_expr(
232232
ast::ExprKind::Ret(Some(ref expr)) => {
233233
rewrite_unary_prefix(context, "return ", &**expr, shape)
234234
}
235+
ast::ExprKind::Become(ref expr) => rewrite_unary_prefix(context, "become ", &**expr, shape),
235236
ast::ExprKind::Yeet(None) => Some("do yeet".to_owned()),
236237
ast::ExprKind::Yeet(Some(ref expr)) => {
237238
rewrite_unary_prefix(context, "do yeet ", &**expr, shape)

Diff for: src/utils.rs

+1
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ pub(crate) fn is_block_expr(context: &RewriteContext<'_>, expr: &ast::Expr, repr
505505
| ast::ExprKind::Range(..)
506506
| ast::ExprKind::Repeat(..)
507507
| ast::ExprKind::Ret(..)
508+
| ast::ExprKind::Become(..)
508509
| ast::ExprKind::Yeet(..)
509510
| ast::ExprKind::Tup(..)
510511
| ast::ExprKind::Type(..)

0 commit comments

Comments
 (0)