Skip to content

Commit e3876fb

Browse files
committed
fix doc
1 parent c00023b commit e3876fb

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

book/src/lint_configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ Minimum chars an ident can have, anything below or equal to this will be linted.
735735

736736

737737
## `missing-docs-allow-unused`
738-
Whether to allow fields starting with underscore to skip documentation requirements
738+
Whether to allow fields starting with an underscore to skip documentation requirements
739739

740740
**Default Value:** `false`
741741

clippy_config/src/conf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ define_Conf! {
675675
/// Minimum chars an ident can have, anything below or equal to this will be linted.
676676
#[lints(min_ident_chars)]
677677
min_ident_chars_threshold: u64 = 1,
678-
/// Whether to allow fields starting with underscore to skip documentation requirements
678+
/// Whether to allow fields starting with an underscore to skip documentation requirements
679679
#[lints(missing_docs_in_private_items)]
680680
missing_docs_allow_unused: bool = false,
681681
/// Whether to **only** check for missing documentation in items visible within the current

clippy_lints/src/missing_doc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub struct MissingDoc {
4848
/// Whether to **only** check for missing documentation in items visible within the current
4949
/// crate. For example, `pub(crate)` items.
5050
crate_items_only: bool,
51-
/// Whether to allow fields starting with underscore to skip documentation requirements
51+
/// Whether to allow fields starting with an underscore to skip documentation requirements
5252
allow_unused: bool,
5353
/// Stack of whether #[doc(hidden)] is set
5454
/// at each level which has lint attributes.
@@ -264,7 +264,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingDoc {
264264

265265
fn check_field_def(&mut self, cx: &LateContext<'tcx>, sf: &'tcx hir::FieldDef<'_>) {
266266
if !sf.is_positional() {
267-
// Skip checking if the field starts with underscore and allow_unused is enabled
267+
// Skip checking if the field starts with an underscore and allow_unused is enabled
268268
if self.allow_unused && sf.ident.as_str().starts_with('_') {
269269
self.prev_span = Some(sf.span);
270270
return;

tests/ui-toml/missing_docs_allow_unused/missing_docs_allow_unused.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
struct Test {
77
/// This field is documented
88
field1: i32,
9-
_unused: i32, // This should not trigger a warning because it starts with underscore
9+
_unused: i32, // This should not trigger a warning because it starts with an underscore
1010
field3: i32, //~ missing_docs_in_private_items
1111
}
1212

0 commit comments

Comments
 (0)