Skip to content

Commit

Permalink
apply review sugg
Browse files Browse the repository at this point in the history
Signed-off-by: Ruihang Xia <[email protected]>
  • Loading branch information
waynexia committed May 17, 2024
1 parent 17918fc commit 5d4eaf0
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/sql/src/parsers/tql_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,6 @@ impl<'a> ParserContext<'a> {
Ok(TqlParameters::new(start, end, step, lookback, query))
}

pub fn is_delimiter_token(token: &Token, delimiter_token: &[Token]) -> bool {
for delimiter in delimiter_token {
if delimiter == token {
return true;
}
}
false
}

pub fn comma_or_rparen(token: &Token) -> bool {
Self::is_comma(token) || Self::is_rparen(token)
}
Expand Down Expand Up @@ -161,7 +152,7 @@ impl<'a> ParserContext<'a> {
) -> std::result::Result<(String, Token), TQLError> {
let mut tokens = vec![];

while !Self::is_delimiter_token(&parser.peek_token().token, delimiter_tokens) {
while !delimiter_tokens.contains(&parser.peek_token().token) {
let token = parser.next_token().token;
if matches!(token, Token::EOF) {
break;
Expand Down

0 comments on commit 5d4eaf0

Please sign in to comment.