|
2 | 2 |
|
3 | 3 | use crate::ast::{AttrArgs, AttrArgsEq, AttrId, AttrItem, AttrKind, AttrStyle, AttrVec, Attribute};
|
4 | 4 | use crate::ast::{DelimArgs, Expr, ExprKind, LitKind, MetaItemLit};
|
5 |
| -use crate::ast::{MacDelimiter, MetaItem, MetaItemKind, NestedMetaItem, NormalAttr}; |
| 5 | +use crate::ast::{MetaItem, MetaItemKind, NestedMetaItem, NormalAttr}; |
6 | 6 | use crate::ast::{Path, PathSegment, DUMMY_NODE_ID};
|
7 | 7 | use crate::ptr::P;
|
8 | 8 | use crate::token::{self, CommentKind, Delimiter, Token};
|
@@ -196,7 +196,7 @@ impl AttrItem {
|
196 | 196 |
|
197 | 197 | fn meta_item_list(&self) -> Option<ThinVec<NestedMetaItem>> {
|
198 | 198 | match &self.args {
|
199 |
| - AttrArgs::Delimited(args) if args.delim == MacDelimiter::Parenthesis => { |
| 199 | + AttrArgs::Delimited(args) if args.delim == Delimiter::Parenthesis => { |
200 | 200 | MetaItemKind::list_from_tokens(args.tokens.clone())
|
201 | 201 | }
|
202 | 202 | AttrArgs::Delimited(_) | AttrArgs::Eq(..) | AttrArgs::Empty => None,
|
@@ -402,11 +402,9 @@ impl MetaItemKind {
|
402 | 402 | fn from_attr_args(args: &AttrArgs) -> Option<MetaItemKind> {
|
403 | 403 | match args {
|
404 | 404 | AttrArgs::Empty => Some(MetaItemKind::Word),
|
405 |
| - AttrArgs::Delimited(DelimArgs { |
406 |
| - dspan: _, |
407 |
| - delim: MacDelimiter::Parenthesis, |
408 |
| - tokens, |
409 |
| - }) => MetaItemKind::list_from_tokens(tokens.clone()).map(MetaItemKind::List), |
| 405 | + AttrArgs::Delimited(DelimArgs { dspan: _, delim: Delimiter::Parenthesis, tokens }) => { |
| 406 | + MetaItemKind::list_from_tokens(tokens.clone()).map(MetaItemKind::List) |
| 407 | + } |
410 | 408 | AttrArgs::Delimited(..) => None,
|
411 | 409 | AttrArgs::Eq(_, AttrArgsEq::Ast(expr)) => match expr.kind {
|
412 | 410 | ExprKind::Lit(token_lit) => {
|
@@ -578,7 +576,7 @@ pub fn mk_attr_nested_word(
|
578 | 576 | let path = Path::from_ident(outer_ident);
|
579 | 577 | let attr_args = AttrArgs::Delimited(DelimArgs {
|
580 | 578 | dspan: DelimSpan::from_single(span),
|
581 |
| - delim: MacDelimiter::Parenthesis, |
| 579 | + delim: Delimiter::Parenthesis, |
582 | 580 | tokens: inner_tokens,
|
583 | 581 | });
|
584 | 582 | mk_attr(g, style, path, attr_args, span)
|
|
0 commit comments