Rollup merge of #94445 - c410-f3r:more-let-chains, r=cjgillot

4 - Make more use of `let_chains`

Continuation of #94376.

cc #53667
This commit is contained in:
Matthias Krüger 2022-02-28 20:05:17 +01:00 committed by GitHub
commit 5be38d2bb3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 72 additions and 76 deletions

View file

@ -97,15 +97,15 @@ macro_rules! maybe_whole {
#[macro_export]
macro_rules! maybe_recover_from_interpolated_ty_qpath {
($self: expr, $allow_qpath_recovery: expr) => {
if $allow_qpath_recovery && $self.look_ahead(1, |t| t == &token::ModSep) {
if let token::Interpolated(nt) = &$self.token.kind {
if let token::NtTy(ty) = &**nt {
if $allow_qpath_recovery
&& $self.look_ahead(1, |t| t == &token::ModSep)
&& let token::Interpolated(nt) = &$self.token.kind
&& let token::NtTy(ty) = &**nt
{
let ty = ty.clone();
$self.bump();
return $self.maybe_recover_from_bad_qpath_stage_2($self.prev_token.span, ty);
}
}
}
};
}