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::used_underscore_binding is triggered when using _ in function parameters #129

Closed
Licenser opened this issue Oct 1, 2020 · 1 comment · Fixed by #130
Closed

Comments

@Licenser
Copy link

Licenser commented Oct 1, 2020

The following code gives an example of Clippy complaining that _b is a used underscore binding. I suspect this has to do with how async-trait rewrites the function call?

#![deny(clippy::pedantic)]

#[async_trait::async_trait]
pub trait TestTrait {
    async fn a(b: u8, c: u8) -> u8;
}

pub struct TestStruct {}

#[async_trait::async_trait]
impl TestTrait for TestStruct {
    async fn a(_b: u8, c: u8) -> u8 {
        c
    }
}
@Licenser
Copy link
Author

Licenser commented Oct 1, 2020

<3 thank you for the quick fix!

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 a pull request may close this issue.

1 participant