rust-lang/rust-clippy

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

Open

#1673 aperta il 12 apr 2017

Vedi su GitHub
 (18 commenti) (3 reazioni) (0 assegnatari)Rust (1391 fork)batch import
A-lintL-styleT-middlegood first issue

Metriche repository

Star
 (10.406 star)
Metriche merge PR
 (Merge medio 19g 22h) (113 PR mergiate in 30 g)

Descrizione

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.

Guida contributor