diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-05-09 21:29:15 +0000 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-06-19 12:54:34 +0000 |
| commit | 0355d41fd8642c23d4b46b726bad405136cee585 (patch) | |
| tree | dc9db3b674f5bbd54ac1ab33bc37669cf4b859ba /src/tools/rustfmt | |
| parent | d7713feb99d45fb0c8122118c2c29008358e363d (diff) | |
Implement `become` expression formatting in rustfmt
Diffstat (limited to 'src/tools/rustfmt')
| -rw-r--r-- | src/tools/rustfmt/src/expr.rs | 1 | ||||
| -rw-r--r-- | src/tools/rustfmt/src/utils.rs | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/src/tools/rustfmt/src/expr.rs b/src/tools/rustfmt/src/expr.rs index 5dc628adb0c..44aaddd8cb2 100644 --- a/src/tools/rustfmt/src/expr.rs +++ b/src/tools/rustfmt/src/expr.rs @@ -232,6 +232,7 @@ pub(crate) fn format_expr( ast::ExprKind::Ret(Some(ref expr)) => { rewrite_unary_prefix(context, "return ", &**expr, shape) } + ast::ExprKind::Become(ref expr) => rewrite_unary_prefix(context, "become ", &**expr, shape), ast::ExprKind::Yeet(None) => Some("do yeet".to_owned()), ast::ExprKind::Yeet(Some(ref expr)) => { rewrite_unary_prefix(context, "do yeet ", &**expr, shape) diff --git a/src/tools/rustfmt/src/utils.rs b/src/tools/rustfmt/src/utils.rs index ca171657407..890a05b8c82 100644 --- a/src/tools/rustfmt/src/utils.rs +++ b/src/tools/rustfmt/src/utils.rs @@ -505,6 +505,7 @@ pub(crate) fn is_block_expr(context: &RewriteContext<'_>, expr: &ast::Expr, repr | ast::ExprKind::Range(..) | ast::ExprKind::Repeat(..) | ast::ExprKind::Ret(..) + | ast::ExprKind::Become(..) | ast::ExprKind::Yeet(..) | ast::ExprKind::Tup(..) | ast::ExprKind::Type(..) |
