@@ -17,7 +17,7 @@ use rustc_semver::RustcVersion;
1717use rustc_session:: { declare_lint_pass, declare_tool_lint, impl_lint_pass} ;
1818use rustc_span:: source_map:: Span ;
1919use rustc_span:: sym;
20- use rustc_span:: symbol:: { Symbol , SymbolStr } ;
20+ use rustc_span:: symbol:: Symbol ;
2121use semver:: Version ;
2222
2323static UNIX_SYSTEMS : & [ & str ] = & [
@@ -310,8 +310,8 @@ impl<'tcx> LateLintPass<'tcx> for Attributes {
310310 || is_word ( lint, sym:: deprecated)
311311 || is_word ( lint, sym ! ( unreachable_pub) )
312312 || is_word ( lint, sym ! ( unused) )
313- || extract_clippy_lint ( lint) . map_or ( false , |s| s == "wildcard_imports" )
314- || extract_clippy_lint ( lint) . map_or ( false , |s| s == "enum_glob_use" )
313+ || extract_clippy_lint ( lint) . map_or ( false , |s| s. as_str ( ) == "wildcard_imports" )
314+ || extract_clippy_lint ( lint) . map_or ( false , |s| s. as_str ( ) == "enum_glob_use" )
315315 {
316316 return ;
317317 }
@@ -370,15 +370,15 @@ impl<'tcx> LateLintPass<'tcx> for Attributes {
370370}
371371
372372/// Returns the lint name if it is clippy lint.
373- fn extract_clippy_lint ( lint : & NestedMetaItem ) -> Option < SymbolStr > {
373+ fn extract_clippy_lint ( lint : & NestedMetaItem ) -> Option < Symbol > {
374374 if_chain ! {
375375 if let Some ( meta_item) = lint. meta_item( ) ;
376376 if meta_item. path. segments. len( ) > 1 ;
377377 if let tool_name = meta_item. path. segments[ 0 ] . ident;
378378 if tool_name. name == sym:: clippy;
379379 then {
380380 let lint_name = meta_item. path. segments. last( ) . unwrap( ) . ident. name;
381- return Some ( lint_name. as_str ( ) ) ;
381+ return Some ( lint_name) ;
382382 }
383383 }
384384 None
@@ -387,7 +387,7 @@ fn extract_clippy_lint(lint: &NestedMetaItem) -> Option<SymbolStr> {
387387fn check_clippy_lint_names ( cx : & LateContext < ' _ > , name : Symbol , items : & [ NestedMetaItem ] ) {
388388 for lint in items {
389389 if let Some ( lint_name) = extract_clippy_lint ( lint) {
390- if lint_name == "restriction" && name != sym:: allow {
390+ if lint_name. as_str ( ) == "restriction" && name != sym:: allow {
391391 span_lint_and_help (
392392 cx,
393393 BLANKET_CLIPPY_RESTRICTION_LINTS ,
@@ -486,7 +486,7 @@ fn check_attrs(cx: &LateContext<'_>, span: Span, name: Symbol, attrs: &[Attribut
486486
487487fn check_semver ( cx : & LateContext < ' _ > , span : Span , lit : & Lit ) {
488488 if let LitKind :: Str ( is, _) = lit. kind {
489- if Version :: parse ( & is. as_str ( ) ) . is_ok ( ) {
489+ if Version :: parse ( is. as_str ( ) ) . is_ok ( ) {
490490 return ;
491491 }
492492 }
@@ -619,7 +619,7 @@ fn check_mismatched_target_os(cx: &EarlyContext<'_>, attr: &Attribute) {
619619 MetaItemKind :: Word => {
620620 if_chain ! {
621621 if let Some ( ident) = meta. ident( ) ;
622- if let Some ( os) = find_os( & * ident. name. as_str( ) ) ;
622+ if let Some ( os) = find_os( ident. name. as_str( ) ) ;
623623 then {
624624 mismatched. push( ( os, ident. span) ) ;
625625 }
0 commit comments