From 7877a42308a05597840f212d10d2abb27086669f Mon Sep 17 00:00:00 2001 From: mcarton Date: Sat, 19 Mar 2016 15:06:56 +0100 Subject: [PATCH] Fix some spelling mistakes here and there --- src/copies.rs | 2 +- src/derive.rs | 2 +- src/items_after_statements.rs | 6 +++--- src/lib.rs | 4 ++-- src/misc_early.rs | 4 ++-- src/needless_bool.rs | 4 ++-- src/utils/hir.rs | 2 +- tests/compile-fail/bool_comparison.rs | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/copies.rs b/src/copies.rs index 789f852c6c35..04f8aaa37e7b 100644 --- a/src/copies.rs +++ b/src/copies.rs @@ -47,7 +47,7 @@ declare_lint! { /// match foo { /// Bar => bar(), /// Quz => quz(), -/// Baz => bar(), // <= oups +/// Baz => bar(), // <= oops /// } /// ``` declare_lint! { diff --git a/src/derive.rs b/src/derive.rs index 4a20d8018de8..ab4f73eafc09 100644 --- a/src/derive.rs +++ b/src/derive.rs @@ -14,7 +14,7 @@ use utils::{match_path, span_lint_and_then}; /// /// **Why is this bad?** The implementation of these traits must agree (for example for use with /// `HashMap`) so it’s probably a bad idea to use a default-generated `Hash` implementation with -/// an explicitely defined `PartialEq`. In particular, the following must hold for any type: +/// an explicitly defined `PartialEq`. In particular, the following must hold for any type: /// /// ```rust /// k1 == k2 ⇒ hash(k1) == hash(k2) diff --git a/src/items_after_statements.rs b/src/items_after_statements.rs index a2ab72469429..952dcb7ed9c4 100644 --- a/src/items_after_statements.rs +++ b/src/items_after_statements.rs @@ -32,15 +32,15 @@ declare_lint! { "finds blocks where an item comes after a statement" } -pub struct ItemsAfterStatemets; +pub struct ItemsAfterStatements; -impl LintPass for ItemsAfterStatemets { +impl LintPass for ItemsAfterStatements { fn get_lints(&self) -> LintArray { lint_array!(ITEMS_AFTER_STATEMENTS) } } -impl EarlyLintPass for ItemsAfterStatemets { +impl EarlyLintPass for ItemsAfterStatements { fn check_block(&mut self, cx: &EarlyContext, item: &Block) { if in_macro(cx, item.span) { return; diff --git a/src/lib.rs b/src/lib.rs index 7d24b2c89248..75b5ec4cc23a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -134,7 +134,7 @@ pub fn plugin_registrar(reg: &mut Registry) { } Err((err, span)) => { reg.sess.struct_span_err(span, err) - .span_note(span, "Clippy will use defaulf configuration") + .span_note(span, "Clippy will use default configuration") .emit(); utils::conf::Conf::default() } @@ -163,7 +163,7 @@ pub fn plugin_registrar(reg: &mut Registry) { reg.register_early_lint_pass(box precedence::Precedence); reg.register_late_lint_pass(box eta_reduction::EtaPass); reg.register_late_lint_pass(box identity_op::IdentityOp); - reg.register_early_lint_pass(box items_after_statements::ItemsAfterStatemets); + reg.register_early_lint_pass(box items_after_statements::ItemsAfterStatements); reg.register_late_lint_pass(box mut_mut::MutMut); reg.register_late_lint_pass(box mut_reference::UnnecessaryMutPassed); reg.register_late_lint_pass(box len_zero::LenZero); diff --git a/src/misc_early.rs b/src/misc_early.rs index 60e175d63826..b1c584a4b3e0 100644 --- a/src/misc_early.rs +++ b/src/misc_early.rs @@ -110,10 +110,10 @@ impl EarlyLintPass for MiscEarly { let arg_name = sp_ident.node.to_string(); if arg_name.starts_with('_') { - if let Some(correspondance) = registered_names.get(&arg_name[1..]) { + if let Some(correspondence) = registered_names.get(&arg_name[1..]) { span_lint(cx, DUPLICATE_UNDERSCORE_ARGUMENT, - *correspondance, + *correspondence, &format!("`{}` already exists, having another argument having almost the same \ name makes code comprehension and documentation more difficult", arg_name[1..].to_owned()));; diff --git a/src/needless_bool.rs b/src/needless_bool.rs index 43e7cfddadd0..ab5a1e26b20c 100644 --- a/src/needless_bool.rs +++ b/src/needless_bool.rs @@ -105,7 +105,7 @@ impl LateLintPass for BoolComparison { span_lint_and_then(cx, BOOL_COMPARISON, e.span, - "equality checks against true are unnecesary", + "equality checks against true are unnecessary", |db| { db.span_suggestion(e.span, "try simplifying it as shown:", hint); }); @@ -115,7 +115,7 @@ impl LateLintPass for BoolComparison { span_lint_and_then(cx, BOOL_COMPARISON, e.span, - "equality checks against true are unnecesary", + "equality checks against true are unnecessary", |db| { db.span_suggestion(e.span, "try simplifying it as shown:", hint); }); diff --git a/src/utils/hir.rs b/src/utils/hir.rs index ed2a49b3caa4..20c7e33fbb2b 100644 --- a/src/utils/hir.rs +++ b/src/utils/hir.rs @@ -13,7 +13,7 @@ use utils::differing_macro_contexts; pub struct SpanlessEq<'a, 'tcx: 'a> { /// Context used to evaluate constant expressions. cx: &'a LateContext<'a, 'tcx>, - /// If is true, never consider as equal expressions containing fonction calls. + /// If is true, never consider as equal expressions containing function calls. ignore_fn: bool, } diff --git a/tests/compile-fail/bool_comparison.rs b/tests/compile-fail/bool_comparison.rs index 8a792931d02c..836759455197 100644 --- a/tests/compile-fail/bool_comparison.rs +++ b/tests/compile-fail/bool_comparison.rs @@ -5,7 +5,7 @@ fn main() { let x = true; if x == true { "yes" } else { "no" }; - //~^ ERROR equality checks against true are unnecesary + //~^ ERROR equality checks against true are unnecessary //~| HELP try simplifying it as shown: //~| SUGGESTION if x { "yes" } else { "no" }; if x == false { "yes" } else { "no" }; @@ -13,7 +13,7 @@ fn main() { //~| HELP try simplifying it as shown: //~| SUGGESTION if !x { "yes" } else { "no" }; if true == x { "yes" } else { "no" }; - //~^ ERROR equality checks against true are unnecesary + //~^ ERROR equality checks against true are unnecessary //~| HELP try simplifying it as shown: //~| SUGGESTION if x { "yes" } else { "no" }; if false == x { "yes" } else { "no" };