File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,16 @@ declare_clippy_lint! {
2828 /// ```no_run
2929 /// pub mod public_module {
3030 /// struct MyStruct {
31- /// pub first_field: bool,
32- /// pub second_field: bool
31+ /// first_field: bool,
32+ /// second_field: bool
33+ /// }
34+ /// impl MyStruct {
35+ /// pub(crate) fn get_first_field(&self) -> bool {
36+ /// self.first_field
37+ /// }
38+ /// pub(super) fn get_second_field(&self) -> bool {
39+ /// self.second_field
40+ /// }
3341 /// }
3442 /// }
3543 /// ```
@@ -60,7 +68,7 @@ impl EarlyLintPass for FieldScopedVisibilityModifiers {
6068 field. vis . span ,
6169 "scoped visibility modifier on a field" ,
6270 None ,
63- "consider making the field either public or private " ,
71+ "consider making the field private and adding a scoped visibility method to read it " ,
6472 ) ;
6573 }
6674 }
You can’t perform that action at this time.
0 commit comments