rust-lang/rust-clippy

Lint `set_*` and `get_*` methods that do nothing but access the field

Open

#1.673 geöffnet am 12. Apr. 2017

Auf GitHub ansehen
 (18 Kommentare) (3 Reaktionen) (0 zugewiesene Personen)Rust (1.391 Forks)batch import
A-lintL-styleT-middlegood first issue

Repository-Metriken

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

Beschreibung

It is not idiomatic in Rust to have setters and getters. Make the field public instead.

If the type only has a get_foo method but not a set_foo method, suggest naming it foo instead.

Contributor Guide