@@ -27,8 +27,9 @@ use std::io::prelude::*;
27
27
use std:: path:: Path ;
28
28
29
29
use crate :: utils:: internal_lints:: is_lint_ref_type;
30
- use crate :: utils:: {
31
- last_path_segment, match_function_call, match_path, match_type, paths, span_lint, walk_ptrs_ty_depth,
30
+ use clippy_utils:: {
31
+ diagnostics:: span_lint, last_path_segment, match_function_call, match_path, paths, ty:: match_type,
32
+ ty:: walk_ptrs_ty_depth,
32
33
} ;
33
34
34
35
/// This is the output file of the lint collector.
@@ -107,7 +108,7 @@ pub struct MetadataCollector {
107
108
///
108
109
/// We use a Heap here to have the lints added in alphabetic order in the export
109
110
lints : BinaryHeap < LintMetadata > ,
110
- applicability_into : FxHashMap < String , ApplicabilityInfo > ,
111
+ applicability_info : FxHashMap < String , ApplicabilityInfo > ,
111
112
}
112
113
113
114
impl Drop for MetadataCollector {
@@ -120,7 +121,7 @@ impl Drop for MetadataCollector {
120
121
return ;
121
122
}
122
123
123
- let mut applicability_info = std:: mem:: take ( & mut self . applicability_into ) ;
124
+ let mut applicability_info = std:: mem:: take ( & mut self . applicability_info ) ;
124
125
125
126
// Mapping the final data
126
127
let mut lints = std:: mem:: take ( & mut self . lints ) . into_sorted_vec ( ) ;
@@ -272,7 +273,7 @@ impl<'hir> LateLintPass<'hir> for MetadataCollector {
272
273
}
273
274
274
275
for ( lint_name, applicability, is_multi_part) in emission_info. drain ( ..) {
275
- let app_info = self . applicability_into . entry ( lint_name) . or_default ( ) ;
276
+ let app_info = self . applicability_info . entry ( lint_name) . or_default ( ) ;
276
277
app_info. applicability = applicability;
277
278
app_info. is_multi_part_suggestion = is_multi_part;
278
279
}
@@ -354,7 +355,7 @@ fn lint_collection_error_item(cx: &LateContext<'_>, item: &Item<'_>, message: &s
354
355
cx,
355
356
INTERNAL_METADATA_COLLECTOR ,
356
357
item. ident . span ,
357
- & format ! ( "Metadata collection error for `{}`: {}" , item. ident. name, message) ,
358
+ & format ! ( "metadata collection error for `{}`: {}" , item. ident. name, message) ,
358
359
) ;
359
360
}
360
361
@@ -569,7 +570,7 @@ impl<'a, 'hir> IsMultiSpanScanner<'a, 'hir> {
569
570
}
570
571
571
572
/// Add a new single expression suggestion to the counter
572
- fn add_singe_span_suggestion ( & mut self ) {
573
+ fn add_single_span_suggestion ( & mut self ) {
573
574
self . suggestion_count += 1 ;
574
575
}
575
576
@@ -604,7 +605,7 @@ impl<'a, 'hir> intravisit::Visitor<'hir> for IsMultiSpanScanner<'a, 'hir> {
604
605
. any ( |func_path| match_function_call ( self . cx , fn_expr, func_path) . is_some ( ) ) ;
605
606
if found_function {
606
607
// These functions are all multi part suggestions
607
- self . add_singe_span_suggestion ( )
608
+ self . add_single_span_suggestion ( )
608
609
}
609
610
} ,
610
611
ExprKind :: MethodCall ( path, _path_span, arg, _arg_span) => {
@@ -616,7 +617,7 @@ impl<'a, 'hir> intravisit::Visitor<'hir> for IsMultiSpanScanner<'a, 'hir> {
616
617
if * is_multi_part {
617
618
self . add_multi_part_suggestion ( ) ;
618
619
} else {
619
- self . add_singe_span_suggestion ( ) ;
620
+ self . add_single_span_suggestion ( ) ;
620
621
}
621
622
break ;
622
623
}
0 commit comments