This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git


The following commit(s) were added to refs/heads/main by this push:
     new 8de3cb00 Fix complex blocks warning when running clippy (#1488)
8de3cb00 is described below

commit 8de3cb00742242974ead0632ecfdcd136cd6abd7
Author: hulk <[email protected]>
AuthorDate: Fri Nov 1 23:20:19 2024 +0800

    Fix complex blocks warning when running clippy (#1488)
---
 src/dialect/postgresql.rs | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/dialect/postgresql.rs b/src/dialect/postgresql.rs
index 361cc74b..dc458ec5 100644
--- a/src/dialect/postgresql.rs
+++ b/src/dialect/postgresql.rs
@@ -230,14 +230,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)),
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to