From 2665f1066238e46a91ace101b9010e272fc8dfe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Wed, 25 Jul 2018 20:02:52 +0200 Subject: [PATCH] fix a bunch of typos found by codespell --- clippy_lints/src/excessive_precision.rs | 2 +- clippy_lints/src/loops.rs | 2 +- clippy_lints/src/matches.rs | 2 +- clippy_lints/src/neg_cmp_op_on_partial_ord.rs | 2 +- clippy_lints/src/types.rs | 2 +- clippy_lints/src/utils/sugg.rs | 2 +- tests/ui/checked_unwrap.rs | 4 ++-- tests/ui/for_loop.rs | 2 +- tests/ui/infinite_loop.rs | 8 ++++---- tests/ui/matches.stderr | 6 +++--- util/gh-pages/versions.html | 2 +- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/clippy_lints/src/excessive_precision.rs b/clippy_lints/src/excessive_precision.rs index 28819077f9b..2c673fdfe3f 100644 --- a/clippy_lints/src/excessive_precision.rs +++ b/clippy_lints/src/excessive_precision.rs @@ -65,7 +65,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ExcessivePrecision { } impl ExcessivePrecision { - // None if nothing to lint, Some(suggestion) if lint neccessary + // None if nothing to lint, Some(suggestion) if lint necessary fn check(&self, sym: Symbol, fty: FloatTy) -> Option { let max = max_digits(fty); let sym_str = sym.as_str(); diff --git a/clippy_lints/src/loops.rs b/clippy_lints/src/loops.rs index b95bc01c013..85a9c13ff35 100644 --- a/clippy_lints/src/loops.rs +++ b/clippy_lints/src/loops.rs @@ -2217,7 +2217,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarCollectorVisitor<'a, 'tcx> { fn visit_expr(&mut self, ex: &'tcx Expr) { match ex.node { ExprKind::Path(_) => self.insert_def_id(ex), - // If there is any fuction/method call… we just stop analysis + // If there is any function/method call… we just stop analysis ExprKind::Call(..) | ExprKind::MethodCall(..) => self.skip = true, _ => walk_expr(self, ex), diff --git a/clippy_lints/src/matches.rs b/clippy_lints/src/matches.rs index c7452f0027e..6bdcd004134 100644 --- a/clippy_lints/src/matches.rs +++ b/clippy_lints/src/matches.rs @@ -383,7 +383,7 @@ fn check_wild_err_arm(cx: &LateContext<'_, '_>, ex: &Expr, arms: &[Arm]) { arm.pats[0].span, "Err(_) will match all errors, maybe not a good idea", arm.pats[0].span, - "to remove this warning, match each error seperately \ + "to remove this warning, match each error separately \ or use unreachable macro"); } } diff --git a/clippy_lints/src/neg_cmp_op_on_partial_ord.rs b/clippy_lints/src/neg_cmp_op_on_partial_ord.rs index 02007e2de43..f53e2cb0cce 100644 --- a/clippy_lints/src/neg_cmp_op_on_partial_ord.rs +++ b/clippy_lints/src/neg_cmp_op_on_partial_ord.rs @@ -11,7 +11,7 @@ use crate::utils::{self, paths, span_lint}; /// /// **Why is this bad?** /// These operators make it easy to forget that the underlying types actually allow not only three -/// potential Orderings (Less, Equal, Greater) but also a forth one (Uncomparable). This is +/// potential Orderings (Less, Equal, Greater) but also a fourth one (Uncomparable). This is /// especially easy to miss if the operator based comparison result is negated. /// /// **Known problems:** None. diff --git a/clippy_lints/src/types.rs b/clippy_lints/src/types.rs index d016afb4908..7b3f6f20fc7 100644 --- a/clippy_lints/src/types.rs +++ b/clippy_lints/src/types.rs @@ -700,7 +700,7 @@ declare_clippy_lint! { /// **What it does:** Checks for casts of a function pointer to a numeric type not enough to store address. /// -/// **Why is this bad?** Casting a function pointer to not eligable type could truncate the address value. +/// **Why is this bad?** Casting a function pointer to not eligible type could truncate the address value. /// /// **Known problems:** None. /// diff --git a/clippy_lints/src/utils/sugg.rs b/clippy_lints/src/utils/sugg.rs index 91fd5ec874a..11187559bf6 100644 --- a/clippy_lints/src/utils/sugg.rs +++ b/clippy_lints/src/utils/sugg.rs @@ -334,7 +334,7 @@ pub fn make_assoc(op: AssocOp, lhs: &Sugg<'_>, rhs: &Sugg<'_>) -> Sugg<'static> Sugg::BinOp(op, sugg.into()) } -/// Convinience wrapper arround `make_assoc` and `AssocOp::from_ast_binop`. +/// Convenience wrapper around `make_assoc` and `AssocOp::from_ast_binop`. pub fn make_binop(op: ast::BinOpKind, lhs: &Sugg<'_>, rhs: &Sugg<'_>) -> Sugg<'static> { make_assoc(AssocOp::from_ast_binop(op), lhs, rhs) } diff --git a/tests/ui/checked_unwrap.rs b/tests/ui/checked_unwrap.rs index c3d4b8de08b..2b5118fa814 100644 --- a/tests/ui/checked_unwrap.rs +++ b/tests/ui/checked_unwrap.rs @@ -31,11 +31,11 @@ fn main() { if x.is_ok() { x = Err(()); x.unwrap(); // not unnecessary because of mutation of x - // it will always panic but the lint is not smart enoguh to see this (it only checks if conditions). + // it will always panic but the lint is not smart enough to see this (it only checks if conditions). } else { x = Ok(()); x.unwrap_err(); // not unnecessary because of mutation of x - // it will always panic but the lint is not smart enoguh to see this (it only checks if conditions). + // it will always panic but the lint is not smart enough to see this (it only checks if conditions). } } diff --git a/tests/ui/for_loop.rs b/tests/ui/for_loop.rs index e28a8f1e178..bc0c3172bf0 100644 --- a/tests/ui/for_loop.rs +++ b/tests/ui/for_loop.rs @@ -389,7 +389,7 @@ fn main() { let m: Rc> = Rc::new(HashMap::new()); for (_, v) in &*m { let _v = v; - // Here the `*` is not actually necesarry, but the test tests that we don't + // Here the `*` is not actually necessary, but the test tests that we don't // suggest // `in *m.values()` as we used to } diff --git a/tests/ui/infinite_loop.rs b/tests/ui/infinite_loop.rs index aa4f8b53f6c..9e801911602 100644 --- a/tests/ui/infinite_loop.rs +++ b/tests/ui/infinite_loop.rs @@ -9,7 +9,7 @@ fn foob() -> bool { unimplemented!() } #[allow(many_single_char_names)] fn immutable_condition() { - // Should warn when all vars mentionned are immutable + // Should warn when all vars mentioned are immutable let y = 0; while y < 10 { println!("KO - y is immutable"); @@ -69,11 +69,11 @@ fn unused_var() { while i < 3 { j = 3; - println!("KO - i not mentionned"); + println!("KO - i not mentioned"); } while i < 3 && j > 0 { - println!("KO - i and j not mentionned"); + println!("KO - i and j not mentioned"); } while i < 3 { @@ -84,7 +84,7 @@ fn unused_var() { while i < 3 && j > 0 { i = 5; - println!("OK - i in cond and mentionned"); + println!("OK - i in cond and mentioned"); } } diff --git a/tests/ui/matches.stderr b/tests/ui/matches.stderr index 6554b6d3449..5bfc3271c45 100644 --- a/tests/ui/matches.stderr +++ b/tests/ui/matches.stderr @@ -164,7 +164,7 @@ error: Err(_) will match all errors, maybe not a good idea | ^^^^^^ | = note: `-D match-wild-err-arm` implied by `-D warnings` - = note: to remove this warning, match each error seperately or use unreachable macro + = note: to remove this warning, match each error separately or use unreachable macro error: this `match` has identical arm bodies --> $DIR/matches.rs:131:18 @@ -191,7 +191,7 @@ error: Err(_) will match all errors, maybe not a good idea 138 | Err(_) => {panic!()} | ^^^^^^ | - = note: to remove this warning, match each error seperately or use unreachable macro + = note: to remove this warning, match each error separately or use unreachable macro error: this `match` has identical arm bodies --> $DIR/matches.rs:137:18 @@ -217,7 +217,7 @@ error: Err(_) will match all errors, maybe not a good idea 144 | Err(_) => {panic!();} | ^^^^^^ | - = note: to remove this warning, match each error seperately or use unreachable macro + = note: to remove this warning, match each error separately or use unreachable macro error: this `match` has identical arm bodies --> $DIR/matches.rs:143:18 diff --git a/util/gh-pages/versions.html b/util/gh-pages/versions.html index 310a3873691..5678ebec722 100644 --- a/util/gh-pages/versions.html +++ b/util/gh-pages/versions.html @@ -14,7 +14,7 @@