diff options
| author | Caio <c410.f3r@gmail.com> | 2022-02-28 07:49:56 -0300 |
|---|---|---|
| committer | Caio <c410.f3r@gmail.com> | 2022-02-28 07:49:56 -0300 |
| commit | e3e902bb06143c8dcf72be392e95c3e6dc517f1a (patch) | |
| tree | 56d2903c7b69ee24d9864270a24288c9735d885c /compiler/rustc_parse/src/parser/path.rs | |
| parent | 427cf81206d3b6cf41c86c1b9ce113a33f1ce860 (diff) | |
| download | rust-e3e902bb06143c8dcf72be392e95c3e6dc517f1a.tar.gz rust-e3e902bb06143c8dcf72be392e95c3e6dc517f1a.zip | |
4 - Make more use of `let_chains`
Continuation of #94376. cc #53667
Diffstat (limited to 'compiler/rustc_parse/src/parser/path.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/path.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/rustc_parse/src/parser/path.rs b/compiler/rustc_parse/src/parser/path.rs index 0ffc9d09355..5e537d7b95c 100644 --- a/compiler/rustc_parse/src/parser/path.rs +++ b/compiler/rustc_parse/src/parser/path.rs @@ -658,13 +658,13 @@ impl<'a> Parser<'a> { &self, gen_arg: GenericArg, ) -> Result<(Ident, Option<GenericArgs>), GenericArg> { - if let GenericArg::Type(ty) = &gen_arg { - if let ast::TyKind::Path(qself, path) = &ty.kind { - if qself.is_none() && path.segments.len() == 1 { - let seg = &path.segments[0]; - return Ok((seg.ident, seg.args.as_deref().cloned())); - } - } + if let GenericArg::Type(ty) = &gen_arg + && let ast::TyKind::Path(qself, path) = &ty.kind + && qself.is_none() + && path.segments.len() == 1 + { + let seg = &path.segments[0]; + return Ok((seg.ident, seg.args.as_deref().cloned())); } Err(gen_arg) } |
