about summary refs log tree commit diff
path: root/src/tools/rustfmt
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-08-03 04:26:42 +0000
committerbors <bors@rust-lang.org>2023-08-03 04:26:42 +0000
commitfb31b3c34ef4a67bcd5b1dad919dfaa4cab2c569 (patch)
tree7ac3711aa1751e27e3bed79e7cd7f24a74031991 /src/tools/rustfmt
parentd8bbef50bbad789e26219f4ec88b5d73b05570a3 (diff)
parentd75ee2a6bcfc2ec9b21c0bb1ffaf34ff6b7161f1 (diff)
downloadrust-fb31b3c34ef4a67bcd5b1dad919dfaa4cab2c569.tar.gz
rust-fb31b3c34ef4a67bcd5b1dad919dfaa4cab2c569.zip
Auto merge of #114353 - nnethercote:parser-ast-cleanups, r=petrochenkov
Some parser and AST cleanups

Things I found while looking closely at this code.

r? `@petrochenkov`
Diffstat (limited to 'src/tools/rustfmt')
-rw-r--r--src/tools/rustfmt/src/expr.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/tools/rustfmt/src/expr.rs b/src/tools/rustfmt/src/expr.rs
index 5b1b4fbd491..739afb4e0ac 100644
--- a/src/tools/rustfmt/src/expr.rs
+++ b/src/tools/rustfmt/src/expr.rs
@@ -1382,12 +1382,8 @@ pub(crate) fn can_be_overflowed_expr(
                 || (context.use_block_indent() && args_len == 1)
         }
         ast::ExprKind::MacCall(ref mac) => {
-            match (
-                rustc_ast::ast::MacDelimiter::from_token(mac.args.delim.to_token()),
-                context.config.overflow_delimited_expr(),
-            ) {
-                (Some(ast::MacDelimiter::Bracket), true)
-                | (Some(ast::MacDelimiter::Brace), true) => true,
+            match (mac.args.delim, context.config.overflow_delimited_expr()) {
+                (Delimiter::Bracket, true) | (Delimiter::Brace, true) => true,
                 _ => context.use_block_indent() && args_len == 1,
             }
         }