dtolnay / async-trait

Type erasure for async trait methods
Apache License 2.0
1.84k stars 85 forks source link

0.1.44 starts triggering clippy::let-unit-value (off by default) warning #147

Closed ndmitchell closed 3 years ago

ndmitchell commented 3 years ago

On upgrading from 0.1.42 to 0.1.44 we started getting a warning about clippy::let-unit-value, which we fixed by https://github.com/facebookexperimental/starlark-rust/commit/63ac2317f263dc4c1e89d7fa6acfbeac504071bf. As a minimal reproducer:

struct MyType;

#[async_trait]
trait MyTrait {
    async fn foo();
}

#[async_trait]
impl MyTrait for MyType {
    async fn foo() {}
}

Note that we explicitly enable clippy::let-unit-value as it generally has been a useful hint.

It seems like anything that returns () as a result is likely to raise this issue. Perhaps the generated code could disable this lint?