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
ba294a816b
commit
d75ee2a6bc
13 changed files with 37 additions and 67 deletions
|
@ -193,10 +193,9 @@ impl<'a> Parser<'a> {
|
|||
/// At this point, the `!` token after the path has already been eaten.
|
||||
fn parse_stmt_mac(&mut self, lo: Span, attrs: AttrVec, path: ast::Path) -> PResult<'a, Stmt> {
|
||||
let args = self.parse_delim_args()?;
|
||||
let delim = args.delim.to_token();
|
||||
let hi = self.prev_token.span;
|
||||
|
||||
let style = match delim {
|
||||
let style = match args.delim {
|
||||
Delimiter::Brace => MacStmtStyle::Braces,
|
||||
_ => MacStmtStyle::NoBraces,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue