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 warns for macro generated code #3110

Closed
flying-sheep opened this issue Apr 18, 2023 · 1 comment
Closed

Clippy warns for macro generated code #3110

flying-sheep opened this issue Apr 18, 2023 · 1 comment
Labels

Comments

@flying-sheep
Copy link

flying-sheep commented Apr 18, 2023

Bug Description

When annotating a method with pyo3(signature = (...)), clippy complains and I don’t see a way to turn it off:

Steps to Reproduce

#[pymethods]
impl Pen {
    #[new]
    #[pyo3(signature = (
        color=Default::default(),
        ...
    ))]
    fn new(
        color: Rgba,
        ...
    ) -> Self {
        ...
    }
}

Backtrace

error: redundant closure
  --> src/xdot_parse/draw.rs:42:15
   |
42 |           color=Default::default(),
   |  _______________^
...  |
50 | |     fn new(
51 | |         color: Rgba,
   | |___________________^ help: replace the closure with the function itself: `Default::default`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
   = note: `-D clippy::redundant-closure` implied by `-D warnings`

OS: Arch Linux
python --version: 3.10.9
rustc --version: 1.68.2
PyO3: 0.18.1
Python installation: pacman

@davidhewitt
Copy link
Member

davidhewitt commented Apr 18, 2023

This was fixed in #2990 / 0.18.2. Please retry with an up to date version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants