Skip to content

Commit 94bf5bc

Browse files
committed
Auto merge of #11058 - Centri3:typos, r=xFrednet
Fix typos Just a couple misc typos I found changelog: none
2 parents 37f4c17 + 09cd093 commit 94bf5bc

File tree

13 files changed

+21
-19
lines changed

13 files changed

+21
-19
lines changed

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:

clippy_utils/src/higher.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_lint::LateContext;
1313
use rustc_span::{sym, symbol, Span};
1414

1515
/// The essential nodes of a desugared for loop as well as the entire span:
16-
/// `for pat in arg { body }` becomes `(pat, arg, body)`. Return `(pat, arg, body, span)`.
16+
/// `for pat in arg { body }` becomes `(pat, arg, body)`. Returns `(pat, arg, body, span)`.
1717
pub struct ForLoop<'tcx> {
1818
/// `for` loop item
1919
pub pat: &'tcx hir::Pat<'tcx>,
@@ -264,7 +264,7 @@ impl<'a> Range<'a> {
264264
}
265265
}
266266

267-
/// Represent the pre-expansion arguments of a `vec!` invocation.
267+
/// Represents the pre-expansion arguments of a `vec!` invocation.
268268
pub enum VecArgs<'a> {
269269
/// `vec![elem; len]`
270270
Repeat(&'a hir::Expr<'a>, &'a hir::Expr<'a>),
@@ -398,7 +398,7 @@ impl<'hir> WhileLet<'hir> {
398398
}
399399
}
400400

401-
/// Converts a hir binary operator to the corresponding `ast` type.
401+
/// Converts a `hir` binary operator to the corresponding `ast` type.
402402
#[must_use]
403403
pub fn binop(op: hir::BinOpKind) -> ast::BinOpKind {
404404
match op {
@@ -436,7 +436,7 @@ pub enum VecInitKind {
436436
WithExprCapacity(HirId),
437437
}
438438

439-
/// Checks if given expression is an initialization of `Vec` and returns its kind.
439+
/// Checks if the given expression is an initialization of `Vec` and returns its kind.
440440
pub fn get_vec_init_kind<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) -> Option<VecInitKind> {
441441
if let ExprKind::Call(func, args) = expr.kind {
442442
match func.kind {

0 commit comments

Comments
 (0)