diff options
| -rw-r--r-- | book/src/lint_configuration.md | 2 | ||||
| -rw-r--r-- | clippy_config/src/conf.rs | 2 | ||||
| -rw-r--r-- | clippy_lints/src/missing_doc.rs | 4 | ||||
| -rw-r--r-- | tests/ui-toml/missing_docs_allow_unused/missing_docs_allow_unused.rs | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/book/src/lint_configuration.md b/book/src/lint_configuration.md index cc8e362e836..58c79c119cc 100644 --- a/book/src/lint_configuration.md +++ b/book/src/lint_configuration.md @@ -735,7 +735,7 @@ Minimum chars an ident can have, anything below or equal to this will be linted. ## `missing-docs-allow-unused` -Whether to allow fields starting with underscore to skip documentation requirements +Whether to allow fields starting with an underscore to skip documentation requirements **Default Value:** `false` diff --git a/clippy_config/src/conf.rs b/clippy_config/src/conf.rs index c1a561aa407..aef0516b75b 100644 --- a/clippy_config/src/conf.rs +++ b/clippy_config/src/conf.rs @@ -675,7 +675,7 @@ define_Conf! { /// Minimum chars an ident can have, anything below or equal to this will be linted. #[lints(min_ident_chars)] min_ident_chars_threshold: u64 = 1, - /// Whether to allow fields starting with underscore to skip documentation requirements + /// Whether to allow fields starting with an underscore to skip documentation requirements #[lints(missing_docs_in_private_items)] missing_docs_allow_unused: bool = false, /// Whether to **only** check for missing documentation in items visible within the current diff --git a/clippy_lints/src/missing_doc.rs b/clippy_lints/src/missing_doc.rs index 5d228f7ea43..1707f9d4fc9 100644 --- a/clippy_lints/src/missing_doc.rs +++ b/clippy_lints/src/missing_doc.rs @@ -48,7 +48,7 @@ pub struct MissingDoc { /// Whether to **only** check for missing documentation in items visible within the current /// crate. For example, `pub(crate)` items. crate_items_only: bool, - /// Whether to allow fields starting with underscore to skip documentation requirements + /// Whether to allow fields starting with an underscore to skip documentation requirements allow_unused: bool, /// Stack of whether #[doc(hidden)] is set /// at each level which has lint attributes. @@ -264,7 +264,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingDoc { fn check_field_def(&mut self, cx: &LateContext<'tcx>, sf: &'tcx hir::FieldDef<'_>) { if !sf.is_positional() { - // Skip checking if the field starts with underscore and allow_unused is enabled + // Skip checking if the field starts with an underscore and allow_unused is enabled if self.allow_unused && sf.ident.as_str().starts_with('_') { self.prev_span = Some(sf.span); return; diff --git a/tests/ui-toml/missing_docs_allow_unused/missing_docs_allow_unused.rs b/tests/ui-toml/missing_docs_allow_unused/missing_docs_allow_unused.rs index bda3fbc928b..a738ff959fe 100644 --- a/tests/ui-toml/missing_docs_allow_unused/missing_docs_allow_unused.rs +++ b/tests/ui-toml/missing_docs_allow_unused/missing_docs_allow_unused.rs @@ -6,7 +6,7 @@ struct Test { /// This field is documented field1: i32, - _unused: i32, // This should not trigger a warning because it starts with underscore + _unused: i32, // This should not trigger a warning because it starts with an underscore field3: i32, //~ missing_docs_in_private_items } |
