Skip to content

Commit

Permalink
Change help message to be less suggestive of how a field should be used
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleoneill committed Jun 16, 2024
1 parent ff7e472 commit e2e57e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/field_scoped_visibility_modifiers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl EarlyLintPass for FieldScopedVisibilityModifiers {
field.vis.span,
"scoped visibility modifier on a field",
None,
"consider making the field private and adding a scoped visibility method to read it",
"consider making the field private and adding a scoped visibility method for it",
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/field_scoped_visibility_modifiers.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error: scoped visibility modifier on a field
LL | pub(crate) pub_crate_field: bool,
| ^^^^^^^^^^
|
= help: consider making the field private and adding a scoped visibility method to read it
= help: consider making the field private and adding a scoped visibility method for it
= note: `-D clippy::field-scoped-visibility-modifiers` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::field_scoped_visibility_modifiers)]`

Expand All @@ -14,15 +14,15 @@ error: scoped visibility modifier on a field
LL | pub(in crate::pub_module) pub_in_path_field: bool,
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider making the field private and adding a scoped visibility method to read it
= help: consider making the field private and adding a scoped visibility method for it

error: scoped visibility modifier on a field
--> tests/ui/field_scoped_visibility_modifiers.rs:11:9
|
LL | pub(super) pub_super_field: bool,
| ^^^^^^^^^^
|
= help: consider making the field private and adding a scoped visibility method to read it
= help: consider making the field private and adding a scoped visibility method for it

error: aborting due to 3 previous errors

0 comments on commit e2e57e6

Please sign in to comment.