mcarton / rust-derivative

A set of alternative `derive` attributes for Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

enum variant with one or more field causes clippy::let_underscore_untyped on Debug derive

KisaragiEffective opened this issue · comments

consider this example:

    #[derive(Derivative)]
    #[derivative(Debug)]
    enum X {
        Hi(String)
    }

A warning emitted by clippy::let_underscore_untyped. Generated code:

    #[derivative(Debug)]
    enum X {
        Hi(String),
    }
    #[allow(unused_qualifications)]
    #[allow(clippy::unneeded_field_pattern)]
    impl ::std::fmt::Debug for X {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
            match *self {
                X::Hi(ref __arg_0) => {
                    let mut __debug_trait_builder = __f.debug_tuple("Hi");
                    let _ = __debug_trait_builder.field(&&(*__arg_0));
                    __debug_trait_builder.finish()
                }
            }
        }
    }

version: 2.2.0