Skip to content

Commit c75a734

Browse files
committed
Remove redundant matching
1 parent 313e71a commit c75a734

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

compiler/rustc_expand/src/expand.rs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,25 +1087,19 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
10871087
let MacCallStmt { mac, style, attrs, .. } = mac.into_inner();
10881088
Ok((style == MacStmtStyle::Semicolon, mac, attrs.into()))
10891089
}
1090-
StmtKind::Item(ref item) if matches!(item.kind, ItemKind::MacCall(..)) => {
1091-
match stmt.kind {
1092-
StmtKind::Item(item) => match item.into_inner() {
1093-
ast::Item { kind: ItemKind::MacCall(mac), attrs, .. } => {
1094-
Ok((mac.args.need_semicolon(), mac, attrs))
1095-
}
1096-
_ => unreachable!(),
1097-
},
1090+
StmtKind::Item(item) if matches!(item.kind, ItemKind::MacCall(..)) => {
1091+
match item.into_inner() {
1092+
ast::Item { kind: ItemKind::MacCall(mac), attrs, .. } => {
1093+
Ok((mac.args.need_semicolon(), mac, attrs))
1094+
}
10981095
_ => unreachable!(),
10991096
}
11001097
}
1101-
StmtKind::Semi(ref expr) if matches!(expr.kind, ast::ExprKind::MacCall(..)) => {
1102-
match stmt.kind {
1103-
StmtKind::Semi(expr) => match expr.into_inner() {
1104-
ast::Expr { kind: ast::ExprKind::MacCall(mac), attrs, .. } => {
1105-
Ok((mac.args.need_semicolon(), mac, attrs.into()))
1106-
}
1107-
_ => unreachable!(),
1108-
},
1098+
StmtKind::Semi(expr) if matches!(expr.kind, ast::ExprKind::MacCall(..)) => {
1099+
match expr.into_inner() {
1100+
ast::Expr { kind: ast::ExprKind::MacCall(mac), attrs, .. } => {
1101+
Ok((mac.args.need_semicolon(), mac, attrs.into()))
1102+
}
11091103
_ => unreachable!(),
11101104
}
11111105
}

0 commit comments

Comments
 (0)