rust-lang/rust-clippy
在 GitHub 查看Lint `set_*` and `get_*` methods that do nothing but access the field
Open
#1,673 建立於 2017年4月12日
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.