rust-lang/rust-clippy

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

Open

#1,673 创建于 2017年4月12日

在 GitHub 查看
 (18 评论) (3 反应) (0 负责人)Rust (1,391 fork)batch import
A-lintL-styleT-middlegood first issue

仓库指标

Star
 (10,406 star)
PR 合并指标
 (平均合并 19天 22小时) (30 天内合并 113 个 PR)

描述

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.

贡献者指南