Skip to content

Commit ae6341a

Browse files
committed
1 parent 778ace3 commit ae6341a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

clippy_lints/src/booleans.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use rustc::{declare_lint_pass, declare_tool_lint};
1010
use rustc_errors::Applicability;
1111
use syntax::ast::LitKind;
1212
use syntax::source_map::Span;
13+
use syntax_pos::symbol::Symbol;
1314

1415
declare_clippy_lint! {
1516
/// **What it does:** Checks for boolean expressions that can be written more
@@ -255,7 +256,7 @@ fn simplify_not(cx: &LateContext<'_, '_>, expr: &Expr) -> Option<String> {
255256
.iter()
256257
.cloned()
257258
.flat_map(|(a, b)| vec![(a, b), (b, a)])
258-
.find(|&(a, _)| a == path.ident.name.as_str())
259+
.find(|&(a, _)| Symbol::intern(a) == path.ident.name)
259260
.and_then(|(_, neg_method)| Some(format!("{}.{}()", snippet_opt(cx, args[0].span)?, neg_method)))
260261
},
261262
_ => None,

clippy_lints/src/functions.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use rustc_errors::Applicability;
1212
use rustc_target::spec::abi::Abi;
1313
use syntax::ast::Attribute;
1414
use syntax::source_map::Span;
15+
use syntax_pos::symbol::Symbol;
1516

1617
declare_clippy_lint! {
1718
/// **What it does:** Checks for functions with too many parameters.
@@ -464,7 +465,7 @@ fn check_must_use_candidate<'a, 'tcx>(
464465
fn must_use_attr(attrs: &[Attribute]) -> Option<&Attribute> {
465466
attrs
466467
.iter()
467-
.find(|attr| attr.ident().map_or(false, |ident| "must_use" == &ident.as_str()))
468+
.find(|attr| attr.ident().map_or(false, |ident| Symbol::intern("must_use") == ident.name))
468469
}
469470

470471
fn returns_unit(decl: &hir::FnDecl) -> bool {

0 commit comments

Comments
 (0)