Skip to content

Commit 885a182

Browse files
committed
Fix typos
1 parent c7bf05c commit 885a182

File tree

14 files changed

+22
-20
lines changed

14 files changed

+22
-20
lines changed

book/src/lint_configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ The maximum amount of nesting a block can reside in
174174

175175
## `disallowed-names`
176176
The list of disallowed names to lint about. NB: `bar` is not here since it has legitimate uses. The value
177-
`".."` can be used as part of the list to indicate, that the configured values should be appended to the
177+
`".."` can be used as part of the list to indicate that the configured values should be appended to the
178178
default configuration of Clippy. By default, any configuration will replace the default value.
179179

180180
**Default Value:** `["foo", "baz", "quux"]` (`Vec<String>`)

clippy_lints/src/methods/map_unwrap_or.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ use rustc_span::symbol::sym;
1111
use super::MAP_UNWRAP_OR;
1212

1313
/// lint use of `map().unwrap_or_else()` for `Option`s and `Result`s
14-
/// Return true if lint triggered
14+
///
15+
/// Returns true if the lint was emitted
1516
pub(super) fn check<'tcx>(
1617
cx: &LateContext<'tcx>,
1718
expr: &'tcx hir::Expr<'_>,

clippy_lints/src/min_ident_chars.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ declare_clippy_lint! {
2525
/// ### Example
2626
/// ```rust,ignore
2727
/// for m in movies {
28-
/// let title = m.t;
28+
/// let title = m.t;
2929
/// }
3030
/// ```
3131
/// Use instead:

clippy_lints/src/needless_else.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl EarlyLintPass for NeedlessElse {
5151
cx,
5252
NEEDLESS_ELSE,
5353
span,
54-
"this else branch is empty",
54+
"this `else` branch is empty",
5555
"you can remove it",
5656
String::new(),
5757
Applicability::MachineApplicable,

clippy_lints/src/utils/conf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ define_Conf! {
319319
/// Lint: DISALLOWED_NAMES.
320320
///
321321
/// The list of disallowed names to lint about. NB: `bar` is not here since it has legitimate uses. The value
322-
/// `".."` can be used as part of the list to indicate, that the configured values should be appended to the
322+
/// `".."` can be used as part of the list to indicate that the configured values should be appended to the
323323
/// default configuration of Clippy. By default, any configuration will replace the default value.
324324
(disallowed_names: Vec<String> = super::DEFAULT_DISALLOWED_NAMES.iter().map(ToString::to_string).collect()),
325325
/// Lint: SEMICOLON_INSIDE_BLOCK.

clippy_utils/src/attrs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,13 @@ pub fn get_unique_attr<'a>(
143143
unique_attr
144144
}
145145

146-
/// Return true if the attributes contain any of `proc_macro`,
146+
/// Returns true if the attributes contain any of `proc_macro`,
147147
/// `proc_macro_derive` or `proc_macro_attribute`, false otherwise
148148
pub fn is_proc_macro(attrs: &[ast::Attribute]) -> bool {
149149
attrs.iter().any(rustc_ast::Attribute::is_proc_macro_attr)
150150
}
151151

152-
/// Return true if the attributes contain `#[doc(hidden)]`
152+
/// Returns true if the attributes contain `#[doc(hidden)]`
153153
pub fn is_doc_hidden(attrs: &[ast::Attribute]) -> bool {
154154
attrs
155155
.iter()

clippy_utils/src/check_proc_macro.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ fn ty_search_pat(ty: &Ty<'_>) -> (Pat, Pat) {
339339
TyKind::Tup(..) => (Pat::Str("("), Pat::Str(")")),
340340
TyKind::OpaqueDef(..) => (Pat::Str("impl"), Pat::Str("")),
341341
TyKind::Path(qpath) => qpath_search_pat(&qpath),
342-
// NOTE: This is missing `TraitObject`. It always return true then.
342+
// NOTE: This is missing `TraitObject`. It will always return true then.
343343
_ => (Pat::Str(""), Pat::Str("")),
344344
}
345345
}

clippy_utils/src/comparisons.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
//! Utility functions about comparison operators.
1+
//! Utility functions for comparison operators.
22
33
#![deny(clippy::missing_docs_in_private_items)]
44

55
use rustc_hir::{BinOpKind, Expr};
66

77
#[derive(PartialEq, Eq, Debug, Copy, Clone)]
8-
/// Represent a normalized comparison operator.
8+
/// Represents a normalized comparison operator.
99
pub enum Rel {
1010
/// `<`
1111
Lt,

clippy_utils/src/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ pub fn constant_with_source<'tcx>(
267267
res.map(|x| (x, ctxt.source))
268268
}
269269

270-
/// Attempts to evaluate an expression only if it's value is not dependent on other items.
270+
/// Attempts to evaluate an expression only if its value is not dependent on other items.
271271
pub fn constant_simple<'tcx>(
272272
lcx: &LateContext<'tcx>,
273273
typeck_results: &ty::TypeckResults<'tcx>,

clippy_utils/src/eager_or_lazy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Utilities for evaluating whether eagerly evaluated expressions can be made lazy and vice versa.
22
//!
33
//! Things to consider:
4-
//! - has the expression side-effects?
4+
//! - does the expression have side-effects?
55
//! - is the expression computationally expensive?
66
//!
77
//! See lints:

0 commit comments

Comments
 (0)