Remove MacDelimiter
.
It's the same as `Delimiter`, minus the `Invisible` variant. I'm generally in favour of using types to make impossible states unrepresentable, but this one feels very low-value, and the conversions between the two types are annoying and confusing. Look at the change in `src/tools/rustfmt/src/expr.rs` for an example: the old code converted from `MacDelimiter` to `Delimiter` and back again, for no good reason. This suggests the author was confused about the types.
This commit is contained in:
parent
4eeecaed1d
commit
d165d4ad38
@ -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,
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user