@@ -1188,9 +1188,8 @@ impl InvocationCollectorNode for P<ast::Item> {
1188
1188
matches ! ( self . kind, ItemKind :: MacCall ( ..) )
1189
1189
}
1190
1190
fn take_mac_call ( self ) -> ( P < ast:: MacCall > , ast:: AttrVec , AddSemicolon ) {
1191
- let node = self . into_inner ( ) ;
1192
- match node. kind {
1193
- ItemKind :: MacCall ( mac) => ( mac, node. attrs , AddSemicolon :: No ) ,
1191
+ match self . kind {
1192
+ ItemKind :: MacCall ( mac) => ( mac, self . attrs , AddSemicolon :: No ) ,
1194
1193
_ => unreachable ! ( ) ,
1195
1194
}
1196
1195
}
@@ -1344,7 +1343,7 @@ impl InvocationCollectorNode for AstNodeWrapper<P<ast::AssocItem>, TraitItemTag>
1344
1343
matches ! ( self . wrapped. kind, AssocItemKind :: MacCall ( ..) )
1345
1344
}
1346
1345
fn take_mac_call ( self ) -> ( P < ast:: MacCall > , ast:: AttrVec , AddSemicolon ) {
1347
- let item = self . wrapped . into_inner ( ) ;
1346
+ let item = self . wrapped ;
1348
1347
match item. kind {
1349
1348
AssocItemKind :: MacCall ( mac) => ( mac, item. attrs , AddSemicolon :: No ) ,
1350
1349
_ => unreachable ! ( ) ,
@@ -1385,7 +1384,7 @@ impl InvocationCollectorNode for AstNodeWrapper<P<ast::AssocItem>, ImplItemTag>
1385
1384
matches ! ( self . wrapped. kind, AssocItemKind :: MacCall ( ..) )
1386
1385
}
1387
1386
fn take_mac_call ( self ) -> ( P < ast:: MacCall > , ast:: AttrVec , AddSemicolon ) {
1388
- let item = self . wrapped . into_inner ( ) ;
1387
+ let item = self . wrapped ;
1389
1388
match item. kind {
1390
1389
AssocItemKind :: MacCall ( mac) => ( mac, item. attrs , AddSemicolon :: No ) ,
1391
1390
_ => unreachable ! ( ) ,
@@ -1426,7 +1425,7 @@ impl InvocationCollectorNode for AstNodeWrapper<P<ast::AssocItem>, TraitImplItem
1426
1425
matches ! ( self . wrapped. kind, AssocItemKind :: MacCall ( ..) )
1427
1426
}
1428
1427
fn take_mac_call ( self ) -> ( P < ast:: MacCall > , ast:: AttrVec , AddSemicolon ) {
1429
- let item = self . wrapped . into_inner ( ) ;
1428
+ let item = self . wrapped ;
1430
1429
match item. kind {
1431
1430
AssocItemKind :: MacCall ( mac) => ( mac, item. attrs , AddSemicolon :: No ) ,
1432
1431
_ => unreachable ! ( ) ,
@@ -1464,9 +1463,8 @@ impl InvocationCollectorNode for P<ast::ForeignItem> {
1464
1463
matches ! ( self . kind, ForeignItemKind :: MacCall ( ..) )
1465
1464
}
1466
1465
fn take_mac_call ( self ) -> ( P < ast:: MacCall > , ast:: AttrVec , AddSemicolon ) {
1467
- let node = self . into_inner ( ) ;
1468
- match node. kind {
1469
- ForeignItemKind :: MacCall ( mac) => ( mac, node. attrs , AddSemicolon :: No ) ,
1466
+ match self . kind {
1467
+ ForeignItemKind :: MacCall ( mac) => ( mac, self . attrs , AddSemicolon :: No ) ,
1470
1468
_ => unreachable ! ( ) ,
1471
1469
}
1472
1470
}
@@ -1601,16 +1599,16 @@ impl InvocationCollectorNode for ast::Stmt {
1601
1599
// `StmtKind`s and treat them as statement macro invocations, not as items or expressions.
1602
1600
let ( add_semicolon, mac, attrs) = match self . kind {
1603
1601
StmtKind :: MacCall ( mac) => {
1604
- let ast:: MacCallStmt { mac, style, attrs, .. } = mac. into_inner ( ) ;
1602
+ let ast:: MacCallStmt { mac, style, attrs, .. } = * mac;
1605
1603
( style == MacStmtStyle :: Semicolon , mac, attrs)
1606
1604
}
1607
- StmtKind :: Item ( item) => match item. into_inner ( ) {
1605
+ StmtKind :: Item ( item) => match * item {
1608
1606
ast:: Item { kind : ItemKind :: MacCall ( mac) , attrs, .. } => {
1609
1607
( mac. args . need_semicolon ( ) , mac, attrs)
1610
1608
}
1611
1609
_ => unreachable ! ( ) ,
1612
1610
} ,
1613
- StmtKind :: Semi ( expr) => match expr. into_inner ( ) {
1611
+ StmtKind :: Semi ( expr) => match * expr {
1614
1612
ast:: Expr { kind : ExprKind :: MacCall ( mac) , attrs, .. } => {
1615
1613
( mac. args . need_semicolon ( ) , mac, attrs)
1616
1614
}
@@ -1691,8 +1689,7 @@ impl InvocationCollectorNode for P<ast::Ty> {
1691
1689
matches ! ( self . kind, ast:: TyKind :: MacCall ( ..) )
1692
1690
}
1693
1691
fn take_mac_call ( self ) -> ( P < ast:: MacCall > , ast:: AttrVec , AddSemicolon ) {
1694
- let node = self . into_inner ( ) ;
1695
- match node. kind {
1692
+ match self . kind {
1696
1693
TyKind :: MacCall ( mac) => ( mac, AttrVec :: new ( ) , AddSemicolon :: No ) ,
1697
1694
_ => unreachable ! ( ) ,
1698
1695
}
@@ -1715,8 +1712,7 @@ impl InvocationCollectorNode for P<ast::Pat> {
1715
1712
matches ! ( self . kind, PatKind :: MacCall ( ..) )
1716
1713
}
1717
1714
fn take_mac_call ( self ) -> ( P < ast:: MacCall > , ast:: AttrVec , AddSemicolon ) {
1718
- let node = self . into_inner ( ) ;
1719
- match node. kind {
1715
+ match self . kind {
1720
1716
PatKind :: MacCall ( mac) => ( mac, AttrVec :: new ( ) , AddSemicolon :: No ) ,
1721
1717
_ => unreachable ! ( ) ,
1722
1718
}
@@ -1742,9 +1738,8 @@ impl InvocationCollectorNode for P<ast::Expr> {
1742
1738
matches ! ( self . kind, ExprKind :: MacCall ( ..) )
1743
1739
}
1744
1740
fn take_mac_call ( self ) -> ( P < ast:: MacCall > , ast:: AttrVec , AddSemicolon ) {
1745
- let node = self . into_inner ( ) ;
1746
- match node. kind {
1747
- ExprKind :: MacCall ( mac) => ( mac, node. attrs , AddSemicolon :: No ) ,
1741
+ match self . kind {
1742
+ ExprKind :: MacCall ( mac) => ( mac, self . attrs , AddSemicolon :: No ) ,
1748
1743
_ => unreachable ! ( ) ,
1749
1744
}
1750
1745
}
@@ -1768,7 +1763,7 @@ impl InvocationCollectorNode for AstNodeWrapper<P<ast::Expr>, OptExprTag> {
1768
1763
matches ! ( self . wrapped. kind, ast:: ExprKind :: MacCall ( ..) )
1769
1764
}
1770
1765
fn take_mac_call ( self ) -> ( P < ast:: MacCall > , ast:: AttrVec , AddSemicolon ) {
1771
- let node = self . wrapped . into_inner ( ) ;
1766
+ let node = self . wrapped ;
1772
1767
match node. kind {
1773
1768
ExprKind :: MacCall ( mac) => ( mac, node. attrs , AddSemicolon :: No ) ,
1774
1769
_ => unreachable ! ( ) ,
@@ -1806,7 +1801,7 @@ impl InvocationCollectorNode for AstNodeWrapper<P<ast::Expr>, MethodReceiverTag>
1806
1801
matches ! ( self . wrapped. kind, ast:: ExprKind :: MacCall ( ..) )
1807
1802
}
1808
1803
fn take_mac_call ( self ) -> ( P < ast:: MacCall > , ast:: AttrVec , AddSemicolon ) {
1809
- let node = self . wrapped . into_inner ( ) ;
1804
+ let node = self . wrapped ;
1810
1805
match node. kind {
1811
1806
ExprKind :: MacCall ( mac) => ( mac, node. attrs , AddSemicolon :: No ) ,
1812
1807
_ => unreachable ! ( ) ,
0 commit comments