We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d6a100 commit d063516Copy full SHA for d063516
clippy_lints/src/methods/mod.rs
@@ -1980,7 +1980,8 @@ fn lint_search_is_some<'a, 'tcx>(
1980
if search_method == "find";
1981
if let hir::ExprKind::Closure(_, _, body_id, ..) = search_args[1].node;
1982
let closure_body = cx.tcx.hir().body(body_id);
1983
- if let hir::PatKind::Ref(..) = closure_body.arguments[0].pat.node;
+ if let Some(closure_arg) = closure_body.arguments.get(0);
1984
+ if let hir::PatKind::Ref(..) = closure_arg.pat.node;
1985
then {
1986
Some(search_snippet.replacen('&', "", 1))
1987
} else {
0 commit comments