diff --git a/clippy_lints/src/booleans.rs b/clippy_lints/src/booleans.rs index c5da0af6f4d1..9e19edcca115 100644 --- a/clippy_lints/src/booleans.rs +++ b/clippy_lints/src/booleans.rs @@ -10,6 +10,7 @@ use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; use syntax::ast::LitKind; use syntax::source_map::Span; +use syntax_pos::symbol::Symbol; declare_clippy_lint! { /// **What it does:** Checks for boolean expressions that can be written more @@ -255,7 +256,7 @@ fn simplify_not(cx: &LateContext<'_, '_>, expr: &Expr) -> Option { .iter() .cloned() .flat_map(|(a, b)| vec![(a, b), (b, a)]) - .find(|&(a, _)| a == path.ident.name.as_str()) + .find(|&(a, _)| Symbol::intern(a) == path.ident.name) .and_then(|(_, neg_method)| Some(format!("{}.{}()", snippet_opt(cx, args[0].span)?, neg_method))) }, _ => None, diff --git a/clippy_lints/src/functions.rs b/clippy_lints/src/functions.rs index 5b2619aa9ba7..43b2372e342c 100644 --- a/clippy_lints/src/functions.rs +++ b/clippy_lints/src/functions.rs @@ -12,6 +12,7 @@ use rustc_errors::Applicability; use rustc_target::spec::abi::Abi; use syntax::ast::Attribute; use syntax::source_map::Span; +use syntax_pos::symbol::Symbol; declare_clippy_lint! { /// **What it does:** Checks for functions with too many parameters. @@ -464,7 +465,7 @@ fn check_must_use_candidate<'a, 'tcx>( fn must_use_attr(attrs: &[Attribute]) -> Option<&Attribute> { attrs .iter() - .find(|attr| attr.ident().map_or(false, |ident| "must_use" == &ident.as_str())) + .find(|attr| attr.ident().map_or(false, |ident| Symbol::intern("must_use") == ident.name)) } fn returns_unit(decl: &hir::FnDecl) -> bool {