Skip to content

Commit e109639

Browse files
authored
Merge pull request #2960 from matthiaskrgr/typos
fix a bunch of typos found by codespell
2 parents 3bd062e + 2665f10 commit e109639

14 files changed

+32
-32
lines changed

clippy_lints/src/excessive_precision.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ExcessivePrecision {
6565
}
6666

6767
impl ExcessivePrecision {
68-
// None if nothing to lint, Some(suggestion) if lint neccessary
68+
// None if nothing to lint, Some(suggestion) if lint necessary
6969
fn check(&self, sym: Symbol, fty: FloatTy) -> Option<String> {
7070
let max = max_digits(fty);
7171
let sym_str = sym.as_str();

clippy_lints/src/loops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2217,7 +2217,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarCollectorVisitor<'a, 'tcx> {
22172217
fn visit_expr(&mut self, ex: &'tcx Expr) {
22182218
match ex.node {
22192219
ExprKind::Path(_) => self.insert_def_id(ex),
2220-
// If there is any fuction/method call… we just stop analysis
2220+
// If there is any function/method call… we just stop analysis
22212221
ExprKind::Call(..) | ExprKind::MethodCall(..) => self.skip = true,
22222222

22232223
_ => walk_expr(self, ex),

clippy_lints/src/matches.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ fn check_wild_err_arm(cx: &LateContext<'_, '_>, ex: &Expr, arms: &[Arm]) {
383383
arm.pats[0].span,
384384
"Err(_) will match all errors, maybe not a good idea",
385385
arm.pats[0].span,
386-
"to remove this warning, match each error seperately \
386+
"to remove this warning, match each error separately \
387387
or use unreachable macro");
388388
}
389389
}

clippy_lints/src/neg_cmp_op_on_partial_ord.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ use if_chain::if_chain;
66
use crate::utils::{self, paths, span_lint};
77

88
/// **What it does:**
9-
/// Checks for the usage of negated comparision operators on types which only implement
9+
/// Checks for the usage of negated comparison operators on types which only implement
1010
/// `PartialOrd` (e.g. `f64`).
1111
///
1212
/// **Why is this bad?**
1313
/// These operators make it easy to forget that the underlying types actually allow not only three
14-
/// potential Orderings (Less, Equal, Greater) but also a forth one (Uncomparable). Escpeccially if
15-
/// the operator based comparision result is negated it is easy to miss that fact.
14+
/// potential Orderings (Less, Equal, Greater) but also a fourth one (Uncomparable). This is
15+
/// especially easy to miss if the operator based comparison result is negated.
1616
///
1717
/// **Known problems:** None.
1818
///
1919
/// **Example:**
2020
///
2121
/// ```rust
22-
/// use core::cmp::Ordering;
23-
///
22+
/// use std::cmp::Ordering;
23+
///
2424
/// // Bad
2525
/// let a = 1.0;
2626
/// let b = std::f64::NAN;
@@ -39,7 +39,7 @@ use crate::utils::{self, paths, span_lint};
3939
declare_clippy_lint! {
4040
pub NEG_CMP_OP_ON_PARTIAL_ORD,
4141
complexity,
42-
"The use of negated comparision operators on partially orded types may produce confusing code."
42+
"The use of negated comparison operators on partially ordered types may produce confusing code."
4343
}
4444

4545
pub struct NoNegCompOpForPartialOrd;
@@ -85,10 +85,10 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NoNegCompOpForPartialOrd {
8585
cx,
8686
NEG_CMP_OP_ON_PARTIAL_ORD,
8787
expr.span,
88-
"The use of negated comparision operators on partially orded \
88+
"The use of negated comparison operators on partially ordered \
8989
types produces code that is hard to read and refactor. Please \
90-
consider to use the `partial_cmp` instead, to make it clear \
91-
that the two values could be incomparable."
90+
consider using the `partial_cmp` method instead, to make it \
91+
clear that the two values could be incomparable."
9292
)
9393
}
9494
}

clippy_lints/src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ declare_clippy_lint! {
700700

701701
/// **What it does:** Checks for casts of a function pointer to a numeric type not enough to store address.
702702
///
703-
/// **Why is this bad?** Casting a function pointer to not eligable type could truncate the address value.
703+
/// **Why is this bad?** Casting a function pointer to not eligible type could truncate the address value.
704704
///
705705
/// **Known problems:** None.
706706
///

clippy_lints/src/utils/sugg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ pub fn make_assoc(op: AssocOp, lhs: &Sugg<'_>, rhs: &Sugg<'_>) -> Sugg<'static>
334334
Sugg::BinOp(op, sugg.into())
335335
}
336336

337-
/// Convinience wrapper arround `make_assoc` and `AssocOp::from_ast_binop`.
337+
/// Convenience wrapper around `make_assoc` and `AssocOp::from_ast_binop`.
338338
pub fn make_binop(op: ast::BinOpKind, lhs: &Sugg<'_>, rhs: &Sugg<'_>) -> Sugg<'static> {
339339
make_assoc(AssocOp::from_ast_binop(op), lhs, rhs)
340340
}

tests/ui/booleans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ fn warn_for_built_in_methods_with_negation() {
116116
}
117117

118118
#[allow(neg_cmp_op_on_partial_ord)]
119-
fn dont_warn_for_negated_partial_ord_comparision() {
119+
fn dont_warn_for_negated_partial_ord_comparison() {
120120
let a: f64 = unimplemented!();
121121
let b: f64 = unimplemented!();
122122
let _ = !(a < b);

tests/ui/checked_unwrap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ fn main() {
3131
if x.is_ok() {
3232
x = Err(());
3333
x.unwrap(); // not unnecessary because of mutation of x
34-
// it will always panic but the lint is not smart enoguh to see this (it only checks if conditions).
34+
// it will always panic but the lint is not smart enough to see this (it only checks if conditions).
3535
} else {
3636
x = Ok(());
3737
x.unwrap_err(); // not unnecessary because of mutation of x
38-
// it will always panic but the lint is not smart enoguh to see this (it only checks if conditions).
38+
// it will always panic but the lint is not smart enough to see this (it only checks if conditions).
3939
}
4040
}
4141

tests/ui/for_loop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ fn main() {
389389
let m: Rc<HashMap<u64, u64>> = Rc::new(HashMap::new());
390390
for (_, v) in &*m {
391391
let _v = v;
392-
// Here the `*` is not actually necesarry, but the test tests that we don't
392+
// Here the `*` is not actually necessary, but the test tests that we don't
393393
// suggest
394394
// `in *m.values()` as we used to
395395
}

tests/ui/infinite_loop.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ fn foob() -> bool { unimplemented!() }
99

1010
#[allow(many_single_char_names)]
1111
fn immutable_condition() {
12-
// Should warn when all vars mentionned are immutable
12+
// Should warn when all vars mentioned are immutable
1313
let y = 0;
1414
while y < 10 {
1515
println!("KO - y is immutable");
@@ -69,11 +69,11 @@ fn unused_var() {
6969

7070
while i < 3 {
7171
j = 3;
72-
println!("KO - i not mentionned");
72+
println!("KO - i not mentioned");
7373
}
7474

7575
while i < 3 && j > 0 {
76-
println!("KO - i and j not mentionned");
76+
println!("KO - i and j not mentioned");
7777
}
7878

7979
while i < 3 {
@@ -84,7 +84,7 @@ fn unused_var() {
8484

8585
while i < 3 && j > 0 {
8686
i = 5;
87-
println!("OK - i in cond and mentionned");
87+
println!("OK - i in cond and mentioned");
8888
}
8989
}
9090

tests/ui/matches.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ error: Err(_) will match all errors, maybe not a good idea
164164
| ^^^^^^
165165
|
166166
= note: `-D match-wild-err-arm` implied by `-D warnings`
167-
= note: to remove this warning, match each error seperately or use unreachable macro
167+
= note: to remove this warning, match each error separately or use unreachable macro
168168

169169
error: this `match` has identical arm bodies
170170
--> $DIR/matches.rs:131:18
@@ -191,7 +191,7 @@ error: Err(_) will match all errors, maybe not a good idea
191191
138 | Err(_) => {panic!()}
192192
| ^^^^^^
193193
|
194-
= note: to remove this warning, match each error seperately or use unreachable macro
194+
= note: to remove this warning, match each error separately or use unreachable macro
195195

196196
error: this `match` has identical arm bodies
197197
--> $DIR/matches.rs:137:18
@@ -217,7 +217,7 @@ error: Err(_) will match all errors, maybe not a good idea
217217
144 | Err(_) => {panic!();}
218218
| ^^^^^^
219219
|
220-
= note: to remove this warning, match each error seperately or use unreachable macro
220+
= note: to remove this warning, match each error separately or use unreachable macro
221221

222222
error: this `match` has identical arm bodies
223223
--> $DIR/matches.rs:143:18

tests/ui/neg_cmp_op_on_partial_ord.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ fn main() {
5959

6060
// Issue 2856: False positive on assert!()
6161
//
62-
// The macro always negates the result of the given comparision in its
62+
// The macro always negates the result of the given comparison in its
6363
// internal check which automatically triggered the lint. As it's an
64-
// external macro there was no chance to do anything about it which lead
64+
// external macro there was no chance to do anything about it which led
6565
// to a whitelisting of all external macros.
6666
assert!(a_value < another_value);
6767
}

tests/ui/neg_cmp_op_on_partial_ord.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
error: The use of negated comparision operators on partially orded types produces code that is hard to read and refactor. Please consider to use the `partial_cmp` instead, to make it clear that the two values could be incomparable.
1+
error: The use of negated comparison operators on partially ordered types produces code that is hard to read and refactor. Please consider using the `partial_cmp` method instead, to make it clear that the two values could be incomparable.
22
--> $DIR/neg_cmp_op_on_partial_ord.rs:17:21
33
|
44
17 | let _not_less = !(a_value < another_value);
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D neg-cmp-op-on-partial-ord` implied by `-D warnings`
88

9-
error: The use of negated comparision operators on partially orded types produces code that is hard to read and refactor. Please consider to use the `partial_cmp` instead, to make it clear that the two values could be incomparable.
9+
error: The use of negated comparison operators on partially ordered types produces code that is hard to read and refactor. Please consider using the `partial_cmp` method instead, to make it clear that the two values could be incomparable.
1010
--> $DIR/neg_cmp_op_on_partial_ord.rs:20:30
1111
|
1212
20 | let _not_less_or_equal = !(a_value <= another_value);
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1414

15-
error: The use of negated comparision operators on partially orded types produces code that is hard to read and refactor. Please consider to use the `partial_cmp` instead, to make it clear that the two values could be incomparable.
15+
error: The use of negated comparison operators on partially ordered types produces code that is hard to read and refactor. Please consider using the `partial_cmp` method instead, to make it clear that the two values could be incomparable.
1616
--> $DIR/neg_cmp_op_on_partial_ord.rs:23:24
1717
|
1818
23 | let _not_greater = !(a_value > another_value);
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
2020

21-
error: The use of negated comparision operators on partially orded types produces code that is hard to read and refactor. Please consider to use the `partial_cmp` instead, to make it clear that the two values could be incomparable.
21+
error: The use of negated comparison operators on partially ordered types produces code that is hard to read and refactor. Please consider using the `partial_cmp` method instead, to make it clear that the two values could be incomparable.
2222
--> $DIR/neg_cmp_op_on_partial_ord.rs:26:33
2323
|
2424
26 | let _not_greater_or_equal = !(a_value >= another_value);

util/gh-pages/versions.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<body>
1515
<div class="container" ng-app="clippy" ng-controller="docVersions">
1616
<div class="page-header">
17-
<h1>Clippy lints documention</h1>
17+
<h1>Clippy lints documentation</h1>
1818
</div>
1919

2020
<div ng-cloak>

0 commit comments

Comments
 (0)