Skip to content

Commit

Permalink
Fix complex blocks warning when running clippy (apache#1488)
Browse files Browse the repository at this point in the history
  • Loading branch information
git-hulk authored and wugeer committed Nov 5, 2024
1 parent 18acb1f commit 391e63d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/dialect/postgresql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,16 @@ pub fn parse_comment(parser: &mut Parser) -> Result<Statement, ParserError> {
}

pub fn parse_create(parser: &mut Parser) -> Option<Result<Statement, ParserError>> {
match parser.maybe_parse(|parser| -> Result<ObjectName, ParserError> {
let name = parser.maybe_parse(|parser| -> Result<ObjectName, ParserError> {
parser.expect_keyword(Keyword::CREATE)?;
parser.expect_keyword(Keyword::TYPE)?;
let name = parser.parse_object_name(false)?;
parser.expect_keyword(Keyword::AS)?;
parser.expect_keyword(Keyword::ENUM)?;
Ok(name)
}) {
});

match name {
Ok(name) => name.map(|name| parse_create_type_as_enum(parser, name)),
Err(e) => Some(Err(e)),
}
Expand Down

0 comments on commit 391e63d

Please sign in to comment.