dynomite icon indicating copy to clipboard operation
dynomite copied to clipboard

#[derive(Item)] makes clippy::needless_arbitrary_self_type complain

Open FuzzyLitchi opened this issue 5 years ago โ€ข 4 comments

๐Ÿ› Bug description

Deriving Item on a struct needlessly types the parameter and makes clippy complain.

๐Ÿค” Expected Behavior

Deriving Item should not needlessly type the self parameter. More info here.

๐Ÿ‘Ÿ Steps to reproduce

Derive Item on a struct and run clippy.

#[derive(Item)]
pub struct Movie {
    #[dynomite(partition_key)]
    pub pk: String,

    #[dynomite(sort_key)]
    pub sk: Uuid,

    pub name: String,

    pub year: u16,
}

I simply ran cargo clippy

๐ŸŒ Your environment

dynomite version: 0.10.0

rustc version: 1.48.0-nightly

clippy version: 0.0.212

FuzzyLitchi avatar Oct 14 '20 09:10 FuzzyLitchi

https://github.com/softprops/dynomite/pull/139 should fix this if it gets merged in

Luminoth avatar Oct 18 '20 18:10 Luminoth

I only checked issues :woman_facepalming:. Anyway that's nice

FuzzyLitchi avatar Oct 19 '20 11:10 FuzzyLitchi

In order to silence this Clippy issue one needs to use #![allow(clippy::needless_arbitrary_self_type)] and it's really annoying. I would like to see #139 merged.

stanislav-tkach avatar Dec 08 '20 14:12 stanislav-tkach

I believe #150, which was merged moments ago, contains the changes in #139 so in a future release (or a git dependency if you want that) this is expected to be resolved. I'm not the crate's maintainer so don't take my word as gospel (and note that I've been deliberately vague about when this will reach downstream users).

phrohdoh avatar Jan 20 '21 18:01 phrohdoh