Skip to content

Commit e2e57e6

Browse files
committed
Change help message to be less suggestive of how a field should be used
1 parent ff7e472 commit e2e57e6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clippy_lints/src/field_scoped_visibility_modifiers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl EarlyLintPass for FieldScopedVisibilityModifiers {
6868
field.vis.span,
6969
"scoped visibility modifier on a field",
7070
None,
71-
"consider making the field private and adding a scoped visibility method to read it",
71+
"consider making the field private and adding a scoped visibility method for it",
7272
);
7373
}
7474
}

tests/ui/field_scoped_visibility_modifiers.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: scoped visibility modifier on a field
44
LL | pub(crate) pub_crate_field: bool,
55
| ^^^^^^^^^^
66
|
7-
= help: consider making the field private and adding a scoped visibility method to read it
7+
= help: consider making the field private and adding a scoped visibility method for it
88
= note: `-D clippy::field-scoped-visibility-modifiers` implied by `-D warnings`
99
= help: to override `-D warnings` add `#[allow(clippy::field_scoped_visibility_modifiers)]`
1010

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

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

2727
error: aborting due to 3 previous errors
2828

0 commit comments

Comments
 (0)