Skip to content

Commit

Permalink
fix fmt and clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
goldmedal committed Dec 28, 2024
1 parent 69385ea commit 08b89d5
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4295,9 +4295,7 @@ impl<'a> Parser<'a> {

fn parse_schema_name(&mut self) -> Result<SchemaName, ParserError> {
if self.parse_keyword(Keyword::AUTHORIZATION) {
Ok(SchemaName::UnnamedAuthorization(
self.parse_identifier()?,
))
Ok(SchemaName::UnnamedAuthorization(self.parse_identifier()?))
} else {
let name = self.parse_object_name(false)?;

Expand Down Expand Up @@ -4782,9 +4780,7 @@ impl<'a> Parser<'a> {
Keyword::INSERT => TriggerEvent::Insert,
Keyword::UPDATE => {
if self.parse_keyword(Keyword::OF) {
let cols = self.parse_comma_separated(|ident| {
Parser::parse_identifier(ident)
})?;
let cols = self.parse_comma_separated(Parser::parse_identifier)?;
TriggerEvent::Update(cols)
} else {
TriggerEvent::Update(vec![])
Expand Down Expand Up @@ -5606,7 +5602,7 @@ impl<'a> Parser<'a> {
/// ```
/// [BigQuery]: https://cloud.google.com/bigquery/docs/reference/standard-sql/procedural-language#declare
pub fn parse_big_query_declare(&mut self) -> Result<Statement, ParserError> {
let names = self.parse_comma_separated(|parser| Parser::parse_identifier(parser))?;
let names = self.parse_comma_separated(Parser::parse_identifier)?;

let data_type = match self.peek_token().token {
Token::Word(w) if w.keyword == Keyword::DEFAULT => None,
Expand Down Expand Up @@ -10113,12 +10109,10 @@ impl<'a> Parser<'a> {
&& self.consume_token(&Token::LParen)
{
let variables = OneOrManyWithParens::Many(
self.parse_comma_separated(|parser: &mut Parser<'a>| {
parser.parse_identifier()
})?
.into_iter()
.map(|ident| ObjectName(vec![ident]))
.collect(),
self.parse_comma_separated(|parser: &mut Parser<'a>| parser.parse_identifier())?
.into_iter()
.map(|ident| ObjectName(vec![ident]))
.collect(),
);
self.expect_token(&Token::RParen)?;
variables
Expand Down Expand Up @@ -11152,9 +11146,7 @@ impl<'a> Parser<'a> {
}
Token::LBrace => {
self.expect_token(&Token::Minus)?;
let symbol = self
.parse_identifier()
.map(MatchRecognizeSymbol::Named)?;
let symbol = self.parse_identifier().map(MatchRecognizeSymbol::Named)?;
self.expect_token(&Token::Minus)?;
self.expect_token(&Token::RBrace)?;
Ok(MatchRecognizePattern::Exclude(symbol))
Expand Down Expand Up @@ -12289,8 +12281,7 @@ impl<'a> Parser<'a> {
) -> Result<Option<ExcludeSelectItem>, ParserError> {
let opt_exclude = if self.parse_keyword(Keyword::EXCLUDE) {
if self.consume_token(&Token::LParen) {
let columns =
self.parse_comma_separated(|parser| parser.parse_identifier())?;
let columns = self.parse_comma_separated(|parser| parser.parse_identifier())?;
self.expect_token(&Token::RParen)?;
Some(ExcludeSelectItem::Multiple(columns))
} else {
Expand Down

0 comments on commit 08b89d5

Please sign in to comment.