about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorr0cky <mu001999@outlook.com>2023-08-03 05:18:19 +0000
committerr0cky <mu001999@outlook.com>2023-08-03 05:18:19 +0000
commit41e85c3d2369ebc44c19c6009a061b64d43672ee (patch)
tree858ad8df061399f0b00b3a2b25c86b889e3ba6d4 /compiler/rustc_parse/src/parser
parentf5243d2bfc9c8982523d443e960f8b8c54f6cd73 (diff)
downloadrust-41e85c3d2369ebc44c19c6009a061b64d43672ee.tar.gz
rust-41e85c3d2369ebc44c19c6009a061b64d43672ee.zip
Apply suggestions
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/pat.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/pat.rs b/compiler/rustc_parse/src/parser/pat.rs
index 615ef28db08..5803d0c1c05 100644
--- a/compiler/rustc_parse/src/parser/pat.rs
+++ b/compiler/rustc_parse/src/parser/pat.rs
@@ -139,7 +139,7 @@ impl<'a> Parser<'a> {
         };
 
         // Parse the first pattern (`p_0`).
-        let mut first_pat = self.parse_pat_no_top_alt(expected, syntax_loc.clone())?;
+        let mut first_pat = self.parse_pat_no_top_alt(expected, syntax_loc)?;
         if rc == RecoverComma::Yes {
             self.maybe_recover_unexpected_comma(first_pat.span, rt)?;
         }
@@ -813,7 +813,9 @@ impl<'a> Parser<'a> {
             | token::DotDotDot | token::DotDotEq | token::DotDot // A range pattern.
             | token::ModSep // A tuple / struct variant pattern.
             | token::Not)) // A macro expanding to a pattern.
-        && !(self.look_ahead(1, |t| t.kind == token::Lt) && self.look_ahead(2, |t| t.can_begin_type())) // May suggest the turbofish syntax for generics, only valid for recoveries.
+        // May suggest the turbofish syntax for generics, only valid for recoveries.
+        && !(self.look_ahead(1, |t| t.kind == token::Lt)
+            && self.look_ahead(2, |t| t.can_begin_type()))
     }
 
     /// Parses `ident` or `ident @ pat`.