]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_expand/src/mbe/transcribe.rs
Rollup merge of #87769 - m-ou-se:alloc-features-cleanup, r=yaahc,dtolnay
[rust.git] / compiler / rustc_expand / src / mbe / transcribe.rs
index 9ed5c8b8ffba5c814d4177fe50772285d1f36ec8..4663dd80fa8bbed095b1203feebf4e02bc94a7cf 100644 (file)
@@ -116,10 +116,8 @@ pub(super) fn transcribe<'a>(
 
     loop {
         // Look at the last frame on the stack.
-        let tree = if let Some(tree) = stack.last_mut().unwrap().next() {
-            // If it still has a TokenTree we have not looked at yet, use that tree.
-            tree
-        } else {
+        // If it still has a TokenTree we have not looked at yet, use that tree.
+        let Some(tree) = stack.last_mut().unwrap().next() else {
             // This else-case never produces a value for `tree` (it `continue`s or `return`s).
 
             // Otherwise, if we have just reached the end of a sequence and we can keep repeating,
@@ -190,9 +188,7 @@ pub(super) fn transcribe<'a>(
                     LockstepIterSize::Constraint(len, _) => {
                         // We do this to avoid an extra clone above. We know that this is a
                         // sequence already.
-                        let (sp, seq) = if let mbe::TokenTree::Sequence(sp, seq) = seq {
-                            (sp, seq)
-                        } else {
+                        let mbe::TokenTree::Sequence(sp, seq) = seq else {
                             unreachable!()
                         };