rust-lang/rust-clippy

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

Open

#1.673 aberto em 12 de abr. de 2017

Ver no GitHub
 (18 comments) (3 reactions) (0 assignees)Rust (1.391 forks)batch import
A-lintL-styleT-middlegood first issue

Métricas do repositório

Stars
 (10.406 stars)
Métricas de merge de PR
 (Mesclagem média 19d 22h) (113 fundiu PRs em 30d)

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.

Guia do colaborador