Skip to content

Commit f83a227

Browse files
authored
Fix various typos (rust-lang#13785)
I ran [Typos](https://github.com/crate-ci/typos) on the project and fixed all of the easy spelling mistakes! I made sure to avoid UI tests, since those changes are more challenging to review due to the changes in `.stderr` files. ``` changelog: Fixed several typos. ``` - \[x] `cargo test` passes locally - \[x] Run `cargo dev fmt`
2 parents a5e46a6 + 4907940 commit f83a227

File tree

9 files changed

+25
-25
lines changed

9 files changed

+25
-25
lines changed

clippy_lints/src/manual_is_power_of_two.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,21 @@ impl LateLintPass<'_> for ManualIsPowerOfTwo {
4343
&& bin_op.node == BinOpKind::Eq
4444
{
4545
// a.count_ones() == 1
46-
if let ExprKind::MethodCall(method_name, reciever, [], _) = left.kind
46+
if let ExprKind::MethodCall(method_name, receiver, [], _) = left.kind
4747
&& method_name.ident.as_str() == "count_ones"
48-
&& let &Uint(_) = cx.typeck_results().expr_ty(reciever).kind()
48+
&& let &Uint(_) = cx.typeck_results().expr_ty(receiver).kind()
4949
&& check_lit(right, 1)
5050
{
51-
build_sugg(cx, expr, reciever, &mut applicability);
51+
build_sugg(cx, expr, receiver, &mut applicability);
5252
}
5353

5454
// 1 == a.count_ones()
55-
if let ExprKind::MethodCall(method_name, reciever, [], _) = right.kind
55+
if let ExprKind::MethodCall(method_name, receiver, [], _) = right.kind
5656
&& method_name.ident.as_str() == "count_ones"
57-
&& let &Uint(_) = cx.typeck_results().expr_ty(reciever).kind()
57+
&& let &Uint(_) = cx.typeck_results().expr_ty(receiver).kind()
5858
&& check_lit(left, 1)
5959
{
60-
build_sugg(cx, expr, reciever, &mut applicability);
60+
build_sugg(cx, expr, receiver, &mut applicability);
6161
}
6262

6363
// a & (a - 1) == 0
@@ -115,8 +115,8 @@ impl LateLintPass<'_> for ManualIsPowerOfTwo {
115115
}
116116
}
117117

118-
fn build_sugg(cx: &LateContext<'_>, expr: &Expr<'_>, reciever: &Expr<'_>, applicability: &mut Applicability) {
119-
let snippet = snippet_with_applicability(cx, reciever.span, "..", applicability);
118+
fn build_sugg(cx: &LateContext<'_>, expr: &Expr<'_>, receiver: &Expr<'_>, applicability: &mut Applicability) {
119+
let snippet = snippet_with_applicability(cx, receiver.span, "..", applicability);
120120

121121
span_lint_and_sugg(
122122
cx,

clippy_lints/src/methods/map_with_unused_argument_over_ranges.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn extract_count_with_applicability(
1919
) -> Option<String> {
2020
let start = range.start?;
2121
let end = range.end?;
22-
// TODO: This doens't handle if either the start or end are negative literals, or if the start is
22+
// TODO: This doesn't handle if either the start or end are negative literals, or if the start is
2323
// not a literal. In the first case, we need to be careful about how we handle computing the
2424
// count to avoid overflows. In the second, we may need to add parenthesis to make the
2525
// suggestion correct.

clippy_lints/src/methods/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3969,7 +3969,7 @@ declare_clippy_lint! {
39693969
///
39703970
/// ### Why is this bad?
39713971
///
3972-
/// In the aformentioned cases it is not necessary to call `min()` or `max()`
3972+
/// In the aforementioned cases it is not necessary to call `min()` or `max()`
39733973
/// to compare values, it may even cause confusion.
39743974
///
39753975
/// ### Example

clippy_lints/src/question_mark.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub struct QuestionMark {
5959
/// As for why we need this in the first place: <https://github.com/rust-lang/rust-clippy/issues/8628>
6060
try_block_depth_stack: Vec<u32>,
6161
/// Keeps track of the number of inferred return type closures we are inside, to avoid problems
62-
/// with the `Err(x.into())` expansion being ambiguious.
62+
/// with the `Err(x.into())` expansion being ambiguous.
6363
inferred_ret_closure_stack: u16,
6464
}
6565

clippy_lints/src/unit_types/unit_arg.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) {
2525
return;
2626
}
2727

28-
let (reciever, args) = match expr.kind {
28+
let (receiver, args) = match expr.kind {
2929
ExprKind::Call(_, args) => (None, args),
3030
ExprKind::MethodCall(_, receiver, args, _) => (Some(receiver), args),
3131
_ => return,
3232
};
3333

34-
let args_to_recover = reciever
34+
let args_to_recover = receiver
3535
.into_iter()
3636
.chain(args)
3737
.filter(|arg| {

clippy_lints/src/unnecessary_literal_bound.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ declare_clippy_lint! {
1717
///
1818
/// ### Why is this bad?
1919
///
20-
/// This leaves the caller unable to use the `&str` as `&'static str`, causing unneccessary allocations or confusion.
20+
/// This leaves the caller unable to use the `&str` as `&'static str`, causing unnecessary allocations or confusion.
2121
/// This is also most likely what you meant to write.
2222
///
2323
/// ### Example

clippy_lints/src/utils/internal_lints/slow_symbol_comparisons.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ use rustc_span::Span;
1212
declare_clippy_lint! {
1313
/// ### What it does
1414
///
15-
/// Detects symbol comparision using `Symbol::intern`.
15+
/// Detects symbol comparison using `Symbol::intern`.
1616
///
1717
/// ### Why is this bad?
1818
///
19-
/// Comparision via `Symbol::as_str()` is faster if the interned symbols are not reused.
19+
/// Comparison via `Symbol::as_str()` is faster if the interned symbols are not reused.
2020
///
2121
/// ### Example
2222
///
2323
/// None, see suggestion.
2424
pub SLOW_SYMBOL_COMPARISONS,
2525
internal,
26-
"detects slow comparisions of symbol"
26+
"detects slow comparisons of symbol"
2727
}
2828

2929
declare_lint_pass!(SlowSymbolComparisons => [SLOW_SYMBOL_COMPARISONS]);

src/driver.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ pub fn main() {
284284
let cap_lints_allow = arg_value(&orig_args, "--cap-lints", |val| val == "allow").is_some()
285285
&& arg_value(&orig_args, "--force-warn", |val| val.contains("clippy::")).is_none();
286286

287-
// If `--no-deps` is enabled only lint the primary pacakge
287+
// If `--no-deps` is enabled only lint the primary package
288288
let relevant_package = !no_deps || env::var("CARGO_PRIMARY_PACKAGE").is_ok();
289289

290290
// Do not run Clippy for Cargo's info queries so that invalid CLIPPY_ARGS are not cached

util/gh-pages/script.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,13 @@ const APPLICABILITIES_FILTER_DEFAULT = {
232232
MaybeIncorrect: true,
233233
HasPlaceholders: true,
234234
};
235-
const URL_PARAMS_CORRESPONDANCE = {
235+
const URL_PARAMS_CORRESPONDENCE = {
236236
"groups_filter": "groups",
237237
"levels_filter": "levels",
238238
"applicabilities_filter": "applicabilities",
239239
"version_filter": "versions",
240240
};
241-
const VERSIONS_CORRESPONDANCE = {
241+
const VERSIONS_CORRESPONDENCE = {
242242
"lte": "≤",
243243
"gte": "≥",
244244
"eq": "=",
@@ -285,7 +285,7 @@ window.filters = {
285285
}
286286
function updateIfNeeded(filterName, obj2) {
287287
const obj1 = filters[filterName];
288-
const name = URL_PARAMS_CORRESPONDANCE[filterName];
288+
const name = URL_PARAMS_CORRESPONDENCE[filterName];
289289
if (!compareObjects(obj1, obj2)) {
290290
urlParams.set(
291291
name,
@@ -316,9 +316,9 @@ window.filters = {
316316
versions.push(`lte:${filters.version_filter["≤"]}`);
317317
}
318318
if (versions.length !== 0) {
319-
urlParams.set(URL_PARAMS_CORRESPONDANCE["version_filter"], versions.join(","));
319+
urlParams.set(URL_PARAMS_CORRESPONDENCE["version_filter"], versions.join(","));
320320
} else {
321-
urlParams.delete(URL_PARAMS_CORRESPONDANCE["version_filter"]);
321+
urlParams.delete(URL_PARAMS_CORRESPONDENCE["version_filter"]);
322322
}
323323

324324
let params = urlParams.toString();
@@ -532,7 +532,7 @@ function parseURLFilters() {
532532
const urlParams = new URLSearchParams(window.location.search);
533533

534534
for (const [key, value] of urlParams.entries()) {
535-
for (const [corres_key, corres_value] of Object.entries(URL_PARAMS_CORRESPONDANCE)) {
535+
for (const [corres_key, corres_value] of Object.entries(URL_PARAMS_CORRESPONDENCE)) {
536536
if (corres_value === key) {
537537
if (key !== "versions") {
538538
const settings = new Set(value.split(","));
@@ -545,7 +545,7 @@ function parseURLFilters() {
545545

546546
for (const [kind, value] of settings) {
547547
const elem = document.querySelector(
548-
`#version-filter input[data-value="${VERSIONS_CORRESPONDANCE[kind]}"]`);
548+
`#version-filter input[data-value="${VERSIONS_CORRESPONDENCE[kind]}"]`);
549549
elem.value = value;
550550
updateVersionFilters(elem, true);
551551
}

0 commit comments

Comments
 (0)