dtolnay / async-trait

Type erasure for async trait methods
Apache License 2.0
1.81k stars 84 forks source link

`clippy::used_underscore_binding` is triggered when using `_` in function parameters #129

Closed Licenser closed 3 years ago

Licenser commented 3 years ago

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 commented 3 years ago

<3 thank you for the quick fix!