Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix complex blocks warning when running clippy #1488

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

git-hulk
Copy link
Member

@git-hulk git-hulk commented Oct 30, 2024

warning: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`
   --> src/dialect/postgresql.rs:233:74
    |
233 |       match parser.maybe_parse(|parser| -> Result<ObjectName, ParserError> {
    |  __________________________________________________________________________^
234 | |         parser.expect_keyword(Keyword::CREATE)?;
235 | |         parser.expect_keyword(Keyword::TYPE)?;
236 | |         let name = parser.parse_object_name(false)?;
...   |
239 | |         Ok(name)
240 | |     }) {
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions
    = note: `#[warn(clippy::blocks_in_conditions)]` on by default

```
warning: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`
   --> src/dialect/postgresql.rs:233:74
    |
233 |       match parser.maybe_parse(|parser| -> Result<ObjectName, ParserError> {
    |  __________________________________________________________________________^
234 | |         parser.expect_keyword(Keyword::CREATE)?;
235 | |         parser.expect_keyword(Keyword::TYPE)?;
236 | |         let name = parser.parse_object_name(false)?;
...   |
239 | |         Ok(name)
240 | |     }) {
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions
    = note: `#[warn(clippy::blocks_in_conditions)]` on by default
```
@coveralls
Copy link

Pull Request Test Coverage Report for Build 11588190891

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.001%) to 89.38%

Totals Coverage Status
Change from base Build 11580333290: 0.001%
Covered Lines: 30415
Relevant Lines: 34029

💛 - Coveralls

Copy link
Contributor

@iffyio iffyio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! cc @alamb

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @git-hulk and @iffyio

@alamb alamb merged commit 8de3cb0 into apache:main Nov 1, 2024
10 checks passed
wugeer pushed a commit to wugeer/sqlparser-rs that referenced this pull request Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants