Skip to content

Commit 63cdbf5

Browse files
author
Alexander Beedie
committed
Avoid unnecessary TokenWithSpan clones
1 parent e81eb14 commit 63cdbf5

2 files changed

Lines changed: 401 additions & 387 deletions

File tree

src/parser/alter.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,18 @@ impl Parser<'_> {
7575
};
7676

7777
let using = if self.parse_keyword(Keyword::USING) {
78-
self.expect_token(&Token::LParen)?;
78+
self.expect_token_is(&Token::LParen)?;
7979
let expr = self.parse_expr()?;
80-
self.expect_token(&Token::RParen)?;
80+
self.expect_token_is(&Token::RParen)?;
8181
Some(expr)
8282
} else {
8383
None
8484
};
8585

8686
let with_check = if self.parse_keywords(&[Keyword::WITH, Keyword::CHECK]) {
87-
self.expect_token(&Token::LParen)?;
87+
self.expect_token_is(&Token::LParen)?;
8888
let expr = self.parse_expr()?;
89-
self.expect_token(&Token::RParen)?;
89+
self.expect_token_is(&Token::RParen)?;
9090
Some(expr)
9191
} else {
9292
None
@@ -218,7 +218,7 @@ impl Parser<'_> {
218218
let add_mfa_method_otp =
219219
if self.parse_keywords(&[Keyword::ADD, Keyword::MFA, Keyword::METHOD, Keyword::OTP]) {
220220
let count = if self.parse_keyword(Keyword::COUNT) {
221-
self.expect_token(&Token::Eq)?;
221+
self.expect_token_is(&Token::Eq)?;
222222
Some(self.parse_value()?.into())
223223
} else {
224224
None

0 commit comments

Comments
 (0)