From 2030c58b81bffab3277913af99472055886e319e Mon Sep 17 00:00:00 2001 From: cui fliter Date: Sun, 29 Oct 2023 11:59:40 +0800 Subject: [PATCH] Fix some typos Signed-off-by: cui fliter --- clippy_lints/src/attrs.rs | 2 +- clippy_lints/src/from_over_into.rs | 6 +++--- clippy_lints/src/matches/single_match.rs | 2 +- clippy_lints/src/reserve_after_initialization.rs | 2 +- clippy_lints/src/unnecessary_map_on_constructor.rs | 2 +- .../internal_lints/almost_standard_lint_formulation.rs | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/clippy_lints/src/attrs.rs b/clippy_lints/src/attrs.rs index c720eba11b1..7a5e3d3f30f 100644 --- a/clippy_lints/src/attrs.rs +++ b/clippy_lints/src/attrs.rs @@ -409,7 +409,7 @@ declare_clippy_lint! { /// /// ### Why is this bad? /// Misspelling `feature` as `features` can be sometimes hard to spot. It - /// may cause conditional compilation not work quitely. + /// may cause conditional compilation not work quietly. /// /// ### Example /// ```no_run diff --git a/clippy_lints/src/from_over_into.rs b/clippy_lints/src/from_over_into.rs index 948d709ce3f..4ccdba910eb 100644 --- a/clippy_lints/src/from_over_into.rs +++ b/clippy_lints/src/from_over_into.rs @@ -110,12 +110,12 @@ impl<'tcx> LateLintPass<'tcx> for FromOverInto { extract_msrv_attr!(LateContext); } -/// Finds the occurences of `Self` and `self` +/// Finds the occurrences of `Self` and `self` struct SelfFinder<'a, 'tcx> { cx: &'a LateContext<'tcx>, - /// Occurences of `Self` + /// Occurrences of `Self` upper: Vec, - /// Occurences of `self` + /// Occurrences of `self` lower: Vec, /// If any of the `self`/`Self` usages were from an expansion, or the body contained a binding /// already named `val` diff --git a/clippy_lints/src/matches/single_match.rs b/clippy_lints/src/matches/single_match.rs index 6b05c6bfffd..5b92c0f7dc8 100644 --- a/clippy_lints/src/matches/single_match.rs +++ b/clippy_lints/src/matches/single_match.rs @@ -51,7 +51,7 @@ pub(crate) fn check(cx: &LateContext<'_>, ex: &Expr<'_>, arms: &[Arm<'_>], expr: // block with 2+ statements or 1 expr and 1+ statement Some(els) } else { - // not a block or an emtpy block w/ comments, don't lint + // not a block or an empty block w/ comments, don't lint return; }; diff --git a/clippy_lints/src/reserve_after_initialization.rs b/clippy_lints/src/reserve_after_initialization.rs index f1ef3709514..c2294303082 100644 --- a/clippy_lints/src/reserve_after_initialization.rs +++ b/clippy_lints/src/reserve_after_initialization.rs @@ -29,7 +29,7 @@ declare_clippy_lint! { #[clippy::version = "1.73.0"] pub RESERVE_AFTER_INITIALIZATION, complexity, - "`reserve` called immediatly after `Vec` creation" + "`reserve` called immediately after `Vec` creation" } impl_lint_pass!(ReserveAfterInitialization => [RESERVE_AFTER_INITIALIZATION]); diff --git a/clippy_lints/src/unnecessary_map_on_constructor.rs b/clippy_lints/src/unnecessary_map_on_constructor.rs index f9d9650db04..b154f75c7ca 100644 --- a/clippy_lints/src/unnecessary_map_on_constructor.rs +++ b/clippy_lints/src/unnecessary_map_on_constructor.rs @@ -9,7 +9,7 @@ use rustc_span::sym; declare_clippy_lint! { /// ### What it does - /// Suggest removing the use of a may (or map_err) method when an Option or Result is being construted. + /// Suggest removing the use of a may (or map_err) method when an Option or Result is being constructed. /// /// ### Why is this bad? /// It introduces unnecessary complexity. In this case the function can be used directly and diff --git a/clippy_lints/src/utils/internal_lints/almost_standard_lint_formulation.rs b/clippy_lints/src/utils/internal_lints/almost_standard_lint_formulation.rs index 570a88a0ed2..d78f67c05f0 100644 --- a/clippy_lints/src/utils/internal_lints/almost_standard_lint_formulation.rs +++ b/clippy_lints/src/utils/internal_lints/almost_standard_lint_formulation.rs @@ -11,7 +11,7 @@ declare_clippy_lint! { /// Checks if lint formulations have a standardized format. /// /// ### Why is this bad? - /// It's not neccessarily bad, but we try to enforce a standard in Clippy. + /// It's not necessarily bad, but we try to enforce a standard in Clippy. /// /// ### Example /// `Checks for use...` can be written as `Checks for usage...` .