X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_expand%2Fsrc%2Fmbe%2Ftranscribe.rs;h=4663dd80fa8bbed095b1203feebf4e02bc94a7cf;hb=71fcb72307e2bb9512d291d33f2adace2406e65a;hp=9ed5c8b8ffba5c814d4177fe50772285d1f36ec8;hpb=fabf502a7a24dfd2dfbc33030cb3d4bad7496b81;p=rust.git diff --git a/compiler/rustc_expand/src/mbe/transcribe.rs b/compiler/rustc_expand/src/mbe/transcribe.rs index 9ed5c8b8ffb..4663dd80fa8 100644 --- a/compiler/rustc_expand/src/mbe/transcribe.rs +++ b/compiler/rustc_expand/src/mbe/transcribe.rs @@ -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!() };