rust-lang/rust-clippy

FR: redundant_field_names should distinguish between all and some fields matching

Open

#3.422 geöffnet am 10. Nov. 2018

Auf GitHub ansehen
 (1 Kommentar) (4 Reaktionen) (1 zugewiesene Person)Rust (1.391 Forks)batch import
C-enhancementL-stylegood first issue

Repository-Metriken

Stars
 (10.406 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 19T 22h) (113 gemergte PRs in 30 T)

Beschreibung

redundant_field_names fires on any field being a match. This impairs readability in cases like this:

let thingy = Thingy {
   calc: big + calculation,
   redundant: redundant,
   other: stuff.into(),
};

As you can see, if you apply the suggestion, you end up with a weird line that is different from the rest. I suggest that the lint be split such that it distinguishes between "all fields are redundant" and "some fields are redundant".

Contributor Guide