dtolnay / async-trait

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

Allow clippy::trivially_copy_pass_by_ref #120

Closed Kestrer closed 4 years ago

Kestrer commented 4 years ago

async-trait copies the method definitions as non-trait methods, which can result in the clippy::trivially_copy_pass_by_ref warning being incorrect fired. Example:

#[async_trait]
trait Foo {
    fn foo(&self);
}

#[async_trait]
// ^ clippy::trivially_copy_pass_by_ref warning since the internal `foo` isn't part of the trait
impl Foo for () {
    fn foo(&self) {}
}