mcarton / rust-derivative

A set of alternative `derive` attributes for Rust
Apache License 2.0
420 stars 46 forks source link

clippy warns when using clone_from = "true" #74

Closed TeXitoi closed 3 years ago

TeXitoi commented 4 years ago

Describe the bug

clippy warns when using clone_from = "true"

To Reproduce

use derivative::Derivative;

#[derive(Derivative)]
#[derivative(Clone(clone_from = "true"))]
pub struct Foo {}

fn main() {}
cargo clippy 
    Checking test-rs v0.1.0 (/home/xxx/dev/test-rs)
warning: unneeded `return` statement
 --> src/main.rs:3:10
  |
3 | #[derive(Derivative)]
  |          ^^^^^^^^^^
  |
  = note: `#[warn(clippy::needless_return)]` on by default
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
  = note: this warning originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: 1 warning emitted

    Finished dev [unoptimized + debuginfo] target(s) in 0.14s

Expected behavior

No warning

Version (please complete the following information):

Please include the output of the following commands, and any other version you think is relevant:

rustup 1.21.1 (7832b2ebe 2019-12-20)
cargo 1.44.1 (88ba85757 2020-06-11)
rustc 1.44.1 (c7087fe00 2020-06-17)