Skip to content

Commit 500cff6

Browse files
committed
nits
1 parent 4b16438 commit 500cff6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

clippy_lints/src/manual_ignore_case_cmp.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ enum MatchType<'a, 'b> {
4545
Literal(&'b LitKind),
4646
}
4747

48-
// && let MethodCall(right_path, right_val, _, _) = right.kind
49-
// && left_path.ident == right_path.ident
5048
fn get_ascii_type<'a, 'b>(cx: &LateContext<'a>, kind: rustc_hir::ExprKind<'b>) -> Option<(Span, MatchType<'a, 'b>)> {
5149
if let MethodCall(path, expr, _, _) = kind {
5250
let is_lower = match path.ident.name.as_str() {
@@ -56,7 +54,7 @@ fn get_ascii_type<'a, 'b>(cx: &LateContext<'a>, kind: rustc_hir::ExprKind<'b>) -
5654
};
5755
let ty_raw = cx.typeck_results().expr_ty(expr);
5856
let ty = ty_raw.peel_refs();
59-
if needs_ref_to_cmp(cx, ty)
57+
if (ty_raw.is_ref() && needs_ref_to_cmp(cx, ty))
6058
|| ty.is_str()
6159
|| ty.is_slice()
6260
|| matches!(get_type_diagnostic_name(cx, ty), Some(sym::OsStr | sym::OsString))

0 commit comments

Comments
 (0)