about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/mod.rs
diff options
context:
space:
mode:
authoryukang <moorekang@gmail.com>2023-03-15 07:10:59 +0800
committeryukang <moorekang@gmail.com>2023-05-01 16:15:17 +0800
commitf54489978d478797108218fda90e1c929e657937 (patch)
tree9c380cc77c7d1b18161a524547e893d55396601f /compiler/rustc_parse/src/parser/mod.rs
parenta4453c20cae5e72073d3cb6180132de2f371d2de (diff)
downloadrust-f54489978d478797108218fda90e1c929e657937.tar.gz
rust-f54489978d478797108218fda90e1c929e657937.zip
fix tests
Diffstat (limited to 'compiler/rustc_parse/src/parser/mod.rs')
-rw-r--r--compiler/rustc_parse/src/parser/mod.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs
index 8cf0f95d90e..b294e13402a 100644
--- a/compiler/rustc_parse/src/parser/mod.rs
+++ b/compiler/rustc_parse/src/parser/mod.rs
@@ -828,11 +828,10 @@ impl<'a> Parser<'a> {
     }
 
     fn expect_any_with_type(&mut self, kets: &[&TokenKind], expect: TokenExpectType) -> bool {
-        let res = kets.iter().any(|k| match expect {
+        kets.iter().any(|k| match expect {
             TokenExpectType::Expect => self.check(k),
             TokenExpectType::NoExpect => self.token == **k,
-        });
-        res
+        })
     }
 
     fn parse_seq_to_before_tokens<T>(
@@ -960,6 +959,7 @@ impl<'a> Parser<'a> {
             let t = f(self)?;
             v.push(t);
         }
+
         Ok((v, trailing, recovered))
     }
 
@@ -1045,7 +1045,6 @@ impl<'a> Parser<'a> {
         f: impl FnMut(&mut Parser<'a>) -> PResult<'a, T>,
     ) -> PResult<'a, (ThinVec<T>, bool /* trailing */)> {
         let (val, trailing, recovered) = self.parse_seq_to_before_end(ket, sep, f)?;
-
         if !recovered {
             self.eat(ket);
         }