Format all the let chains in compiler

This commit is contained in:
Michael Goulet
2023-10-13 08:58:33 +00:00
parent 2763ca50da
commit b2d2184ede
206 changed files with 3120 additions and 2228 deletions

View File

@@ -893,13 +893,15 @@ impl<'a> Parser<'a> {
// to recover from errors, not make more).
let path = if self.may_recover() {
let (span, message, sugg, path, applicability) = match &ty.kind {
TyKind::Ptr(..) | TyKind::Ref(..) if let TyKind::Path(_, path) = &ty.peel_refs().kind => {
TyKind::Ptr(..) | TyKind::Ref(..)
if let TyKind::Path(_, path) = &ty.peel_refs().kind =>
{
(
ty.span.until(path.span),
"consider removing the indirection",
"",
path,
Applicability::MaybeIncorrect
Applicability::MaybeIncorrect,
)
}
TyKind::ImplTrait(_, bounds)
@@ -910,10 +912,10 @@ impl<'a> Parser<'a> {
"use the trait bounds directly",
"",
&tr.trait_ref.path,
Applicability::MachineApplicable
Applicability::MachineApplicable,
)
}
_ => return Err(err)
_ => return Err(err),
};
err.span_suggestion_verbose(span, message, sugg, applicability);
@@ -1027,7 +1029,8 @@ impl<'a> Parser<'a> {
args.into_iter()
.filter_map(|arg| {
if let ast::AngleBracketedArg::Arg(generic_arg) = arg
&& let ast::GenericArg::Lifetime(lifetime) = generic_arg {
&& let ast::GenericArg::Lifetime(lifetime) = generic_arg
{
Some(lifetime)
} else {
None