Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-expand/src/builtin/fn_macro.rs')
-rw-r--r--crates/hir-expand/src/builtin/fn_macro.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/crates/hir-expand/src/builtin/fn_macro.rs b/crates/hir-expand/src/builtin/fn_macro.rs
index 4a9af01091..58ab7f470c 100644
--- a/crates/hir-expand/src/builtin/fn_macro.rs
+++ b/crates/hir-expand/src/builtin/fn_macro.rs
@@ -555,12 +555,11 @@ fn concat_expand(
// FIXME: hack on top of a hack: `$e:expr` captures get surrounded in parentheses
// to ensure the right parsing order, so skip the parentheses here. Ideally we'd
// implement rustc's model. cc https://github.com/rust-lang/rust-analyzer/pull/10623
- if let TtElement::Subtree(subtree, subtree_iter) = &t {
- if let [tt::TokenTree::Leaf(tt)] = subtree_iter.remaining().flat_tokens() {
- if subtree.delimiter.kind == tt::DelimiterKind::Parenthesis {
- t = TtElement::Leaf(tt);
- }
- }
+ if let TtElement::Subtree(subtree, subtree_iter) = &t
+ && let [tt::TokenTree::Leaf(tt)] = subtree_iter.remaining().flat_tokens()
+ && subtree.delimiter.kind == tt::DelimiterKind::Parenthesis
+ {
+ t = TtElement::Leaf(tt);
}
match t {
TtElement::Leaf(tt::Leaf::Literal(it)) if i % 2 == 0 => {