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

Clippy warnings after upgrade to 0.7 #258

Closed
bemyak opened this issue Apr 20, 2021 · 2 comments
Closed

Clippy warnings after upgrade to 0.7 #258

bemyak opened this issue Apr 20, 2021 · 2 comments

Comments

@bemyak
Copy link

bemyak commented Apr 20, 2021

After upgrading to 0.7 Clippy complains about all precedence rules:

    rule full_expression() -> Expression
      = precedence!{
        // omitted
        --
        _ n:operand() _ { Expression::Value(n) }
        "(" _ e:full_expression() _ ")" { e }
      }

error:

warning: try not to call a closure in the expression where it is declared
   --> src/format/roll.rs:330:41
    |
330 |         "(" _ e:full_expression() _ ")" { e }
    |                                         ^^^^^ help: try doing something like: `{ e }`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_call

🤷

@kevinmehall
Copy link
Owner

0.7 wraps code blocks in immediately-invoked closures to control the behavior of return and ?: #248

@bemyak
Copy link
Author

bemyak commented Apr 21, 2021

I see. Since it's not a bug and doesn't have any performance impact, maybe it would be fine to just suppress this warning with

#![allow(clippy::redundant_closure_call)]

?

kevinmehall added a commit that referenced this issue Jul 24, 2021
rust-peg wraps code blocks in immediately-invoked closures to control
the behavior of `return` and `?`. (related: #248)

Fixes #258
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

No branches or pull requests

2 participants