rust-lang/rust-clippy

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

Open

#1 673 ouverte le 12 avr. 2017

Voir sur GitHub
 (18 commentaires) (3 réactions) (0 assignés)Rust (1 391 forks)batch import
A-lintL-styleT-middlegood first issue

Métriques du dépôt

Stars
 (10 406 stars)
Métriques de merge PR
 (Merge moyen 19j 22h) (113 PRs mergées en 30 j)

Description

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.

Guide contributeur