Skip to content

Commit 1990b72

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 + 885a182 commit 1990b72

14 files changed

+22
-20
lines changed

book/src/lint_configuration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ The maximum amount of nesting a block can reside in
175175

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

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

clippy_lints/src/methods/map_unwrap_or.rs

+2-1
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

+1-1
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

+1-1
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

+1-1
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

+2-2
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

+1-1
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

+2-2
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

+1-1
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

+1-1
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

+4-4
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 {

clippy_utils/src/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ fn is_default_equivalent_ctor(cx: &LateContext<'_>, def_id: DefId, path: &QPath<
823823
false
824824
}
825825

826-
/// Return true if the expr is equal to `Default::default` when evaluated.
826+
/// Returns true if the expr is equal to `Default::default` when evaluated.
827827
pub fn is_default_equivalent_call(cx: &LateContext<'_>, repl_func: &Expr<'_>) -> bool {
828828
if_chain! {
829829
if let hir::ExprKind::Path(ref repl_func_qpath) = repl_func.kind;
@@ -2527,7 +2527,8 @@ pub fn span_contains_comment(sm: &SourceMap, span: Span) -> bool {
25272527
});
25282528
}
25292529

2530-
/// Return all the comments a given span contains
2530+
/// Returns all the comments a given span contains
2531+
///
25312532
/// Comments are returned wrapped with their relevant delimiters
25322533
pub fn span_extract_comment(sm: &SourceMap, span: Span) -> String {
25332534
let snippet = sm.span_to_snippet(span).unwrap_or_default();

clippy_utils/src/sugg.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ fn binop_to_string(op: AssocOp, lhs: &str, rhs: &str) -> String {
395395
}
396396
}
397397

398-
/// Return `true` if `sugg` is enclosed in parenthesis.
398+
/// Returns `true` if `sugg` is enclosed in parenthesis.
399399
pub fn has_enclosing_paren(sugg: impl AsRef<str>) -> bool {
400400
let mut chars = sugg.as_ref().chars();
401401
if chars.next() == Some('(') {

tests/ui/needless_else.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: this else branch is empty
1+
error: this `else` branch is empty
22
--> $DIR/needless_else.rs:24:7
33
|
44
LL | } else {

0 commit comments

Comments
 (0)