Skip to content

Commit b4d8d1d

Browse files
committed
Applying PR suggestions (mostly typos)
Co-authored-by: flip1995 <[email protected]> Co-authored-by: phansch <[email protected]>
1 parent c8e9d15 commit b4d8d1d

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

clippy_lints/src/utils/internal_lints/metadata_collector.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ pub struct MetadataCollector {
107107
///
108108
/// We use a Heap here to have the lints added in alphabetic order in the export
109109
lints: BinaryHeap<LintMetadata>,
110-
applicability_into: FxHashMap<String, ApplicabilityInfo>,
110+
applicability_info: FxHashMap<String, ApplicabilityInfo>,
111111
}
112112

113113
impl Drop for MetadataCollector {
@@ -120,7 +120,7 @@ impl Drop for MetadataCollector {
120120
return;
121121
}
122122

123-
let mut applicability_info = std::mem::take(&mut self.applicability_into);
123+
let mut applicability_info = std::mem::take(&mut self.applicability_info);
124124

125125
// Mapping the final data
126126
let mut lints = std::mem::take(&mut self.lints).into_sorted_vec();
@@ -272,7 +272,7 @@ impl<'hir> LateLintPass<'hir> for MetadataCollector {
272272
}
273273

274274
for (lint_name, applicability, is_multi_part) in emission_info.drain(..) {
275-
let app_info = self.applicability_into.entry(lint_name).or_default();
275+
let app_info = self.applicability_info.entry(lint_name).or_default();
276276
app_info.applicability = applicability;
277277
app_info.is_multi_part_suggestion = is_multi_part;
278278
}
@@ -354,7 +354,7 @@ fn lint_collection_error_item(cx: &LateContext<'_>, item: &Item<'_>, message: &s
354354
cx,
355355
INTERNAL_METADATA_COLLECTOR,
356356
item.ident.span,
357-
&format!("Metadata collection error for `{}`: {}", item.ident.name, message),
357+
&format!("metadata collection error for `{}`: {}", item.ident.name, message),
358358
);
359359
}
360360

@@ -569,7 +569,7 @@ impl<'a, 'hir> IsMultiSpanScanner<'a, 'hir> {
569569
}
570570

571571
/// Add a new single expression suggestion to the counter
572-
fn add_singe_span_suggestion(&mut self) {
572+
fn add_single_span_suggestion(&mut self) {
573573
self.suggestion_count += 1;
574574
}
575575

@@ -604,7 +604,7 @@ impl<'a, 'hir> intravisit::Visitor<'hir> for IsMultiSpanScanner<'a, 'hir> {
604604
.any(|func_path| match_function_call(self.cx, fn_expr, func_path).is_some());
605605
if found_function {
606606
// These functions are all multi part suggestions
607-
self.add_singe_span_suggestion()
607+
self.add_single_span_suggestion()
608608
}
609609
},
610610
ExprKind::MethodCall(path, _path_span, arg, _arg_span) => {
@@ -616,7 +616,7 @@ impl<'a, 'hir> intravisit::Visitor<'hir> for IsMultiSpanScanner<'a, 'hir> {
616616
if *is_multi_part {
617617
self.add_multi_part_suggestion();
618618
} else {
619-
self.add_singe_span_suggestion();
619+
self.add_single_span_suggestion();
620620
}
621621
break;
622622
}

clippy_utils/src/diagnostics.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
//! Clippy wrappers around rustc's diagnostic functions.
2+
//!
3+
//! These functions are used by the INTERNAL_METADATA_COLLECTOR lint to collect the corresponding
4+
//! lint applicability. Please make sure that you update the `LINT_EMISSION_FUNCTIONS` variable in
5+
//! `clippy_lints::utils::internal_lints::metadata_collector` when a new function is added
6+
//! or renamed.
7+
//!
8+
//! Thank you!
9+
//! ~The INTERNAL_METADATA_COLLECTOR lint
210
311
use rustc_errors::{Applicability, DiagnosticBuilder};
412
use rustc_hir::HirId;

0 commit comments

Comments
 (0)