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! {
28
28
/// ```no_run
29
29
/// pub mod public_module {
30
30
/// 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
+ /// }
33
41
/// }
34
42
/// }
35
43
/// ```
@@ -60,7 +68,7 @@ impl EarlyLintPass for FieldScopedVisibilityModifiers {
60
68
field. vis . span ,
61
69
"scoped visibility modifier on a field" ,
62
70
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 " ,
64
72
) ;
65
73
}
66
74
}
You can’t perform that action at this time.
0 commit comments